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

javascript - Knockout pushing observable and computed data to an observable array -

'hasOwnProperty' in javascript -

Trouble making a JSON string -