jquery - How to add data-dismiss inside button tag? -


<button aria-hidden="true">close</button> 

i have button tag in html. want add <data-dismiss="modal"> inside button tag jquery become <button data-dismiss="modal" aria-hidden="true">close</button> . there way it?

$('button').attr("data-dismiss","modal");   

.attr takes 2 parameters, attribute , value.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -