+ 1
Can we modify the attributeâs value of the HTML tag dynamically?
5 RĂ©ponses
0
Yes, we can modify the value of the attributes by using JavaScript.
Below is the input element whose attribute will be modified from text to password, JS code to modify the attribute value:
<input type=âtextâ id=âinputFieldâ> document.getElementById(âinputFieldâ).attr(âtypeâ, âpasswordâ);
+ 6
Salihu Ismail jibril it is .getAttribute or .setAttribute instead of .attr
.attr is found in jquery
+ 6
Is this some kind of self-answer spam?đ€
Salihu Ismail jibril Please don't ask a question when you know the answer beforehand. It's dull
+ 4
Salihu Ismail jibril đđđ
+ 2
Yes, you can use javascript. By calling dom