I have a paragraph. I want to provide the color (in hexadecimal) dynamically using js.
HTML CODE:
<p id="ta">this is a para</p>
JS:
window.addEventListener('load', fnc);
function fnc() {
var ta = document.querySelector('#ta');
ta.style.color = "#100000";
}
It automatically converts into rgb form.
Why it automatically converts into rgb?
