i want to change the attribute of a text element from required to not required. I am using javascript to do this. i am calling a function based on the input of the radio button and i am using html 5..
i want to change the attribute of a text element from required to not required. I am using javascript to do this. i am calling a function based on the input of the radio button and i am using html 5..
Share Improve this question asked Aug 21, 2012 at 10:10 SHivSHiv 3624 gold badges10 silver badges22 bronze badges 2- 1 post example to jsFiddle please! – Ilia Ross Commented Aug 21, 2012 at 10:12
- @MihaiIorga i was validation the form elements before clicking submit button. bcoz there was a property in the html5 called required. – SHiv Commented Aug 21, 2012 at 10:26
1 Answer
Reset to default 4document.getElementById("adiv").removeAttribute("style")
document.getElementById("myimage").setAttribute("src","another.gif")
var getvalue=document.getElementById("myimage").getAttribute("src")
Now but it in a function and use it how you wish.
That is how you get set and remove attributes in JavaScript.
Source: http://www.javascriptkit./dhtmltutors/domattribute.shtml
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744303813a4567631.html
评论列表(0条)