+ 1
Can we modify the attribute’s value of the HTML tag dynamically?
5 ответов
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
+ 2
Yes, you can use javascript. By calling dom