how to set attribute of html form from javascript - Stack Overflow

i want to change the attribute of a text element from required to not required. I am using javascript t

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
Add a ment  | 

1 Answer 1

Reset to default 4
document.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

相关推荐

  • how to set attribute of html form from javascript - Stack Overflow

    i want to change the attribute of a text element from required to not required. I am using javascript t

    7天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信