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

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

Command prompt result in label. Python 2.7 -