How to add data-dismiss inside button tag?

user7348570
<button aria-hidden="true">Close</button>

I have a button tag in html. I want to add <data-dismiss="modal"> inside button tag by JQuery so that it become like <button data-dismiss="modal" aria-hidden="true">Close</button> . Is there any way to do it?

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

.attr takes 2 parameters, attribute and the value.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Data-Dismiss: How to dismiss bootstrap modal inside function

From Dev

Data-Dismiss: How to dismiss bootstrap modal inside function

From Dev

jquery - add extra data inside select tag

From Dev

How to add <pre> tag inside the <p> in html?

From Dev

How to add button overLay in Video Tag

From Dev

How to add button overLay in Video Tag

From Dev

How add css attributes in button_tag?

From Dev

Jsoup/Java - How to extract data that is not inside a tag

From Dev

How to put a tag inside data-description

From Dev

Jsoup/Java - How to extract data that is not inside a tag

From Dev

data-dismiss and close button for notification bar

From Dev

how to add progress dialog inside button

From Dev

How to add a button inside a input field

From Dev

How to clear all input fields in bootstrap modal when clicking data-dismiss button?

From Dev

how to change image button inside a tableviewCell without using tag

From Dev

How to Make Button Tag Only Show Image Inside of it

From Dev

how to change image button inside a tableviewCell without using tag

From Dev

How to make a Ajax Submit Button with an html tag inside the label

From Dev

How to dismiss AlertDialog.Builder with custom button

From Dev

How to dismiss a popover only with a button in swift

From Dev

How to add JSON data in select and option tag?

From Dev

How can I dismiss a bootstrap panel using data-dismiss?

From Dev

Add button inside textbox

From Dev

How can I add attribute inside an input tag using jQuery?

From Dev

How to add post meta tag inside do_shortcode in wordpress

From Dev

How can I add a br tag inside of css "after" selector?

From Dev

How to add search box inside <select> tag with ng-option

From Dev

How to add snooze/dismiss animation in android

From Dev

Rails: How to add an empty 'required' attribute to a radio_button_tag

Related Related

  1. 1

    Data-Dismiss: How to dismiss bootstrap modal inside function

  2. 2

    Data-Dismiss: How to dismiss bootstrap modal inside function

  3. 3

    jquery - add extra data inside select tag

  4. 4

    How to add <pre> tag inside the <p> in html?

  5. 5

    How to add button overLay in Video Tag

  6. 6

    How to add button overLay in Video Tag

  7. 7

    How add css attributes in button_tag?

  8. 8

    Jsoup/Java - How to extract data that is not inside a tag

  9. 9

    How to put a tag inside data-description

  10. 10

    Jsoup/Java - How to extract data that is not inside a tag

  11. 11

    data-dismiss and close button for notification bar

  12. 12

    how to add progress dialog inside button

  13. 13

    How to add a button inside a input field

  14. 14

    How to clear all input fields in bootstrap modal when clicking data-dismiss button?

  15. 15

    how to change image button inside a tableviewCell without using tag

  16. 16

    How to Make Button Tag Only Show Image Inside of it

  17. 17

    how to change image button inside a tableviewCell without using tag

  18. 18

    How to make a Ajax Submit Button with an html tag inside the label

  19. 19

    How to dismiss AlertDialog.Builder with custom button

  20. 20

    How to dismiss a popover only with a button in swift

  21. 21

    How to add JSON data in select and option tag?

  22. 22

    How can I dismiss a bootstrap panel using data-dismiss?

  23. 23

    Add button inside textbox

  24. 24

    How can I add attribute inside an input tag using jQuery?

  25. 25

    How to add post meta tag inside do_shortcode in wordpress

  26. 26

    How can I add a br tag inside of css "after" selector?

  27. 27

    How to add search box inside <select> tag with ng-option

  28. 28

    How to add snooze/dismiss animation in android

  29. 29

    Rails: How to add an empty 'required' attribute to a radio_button_tag

HotTag

Archive