Excellent Programming Tricks

Html Custom Atribute | JavaScript | data- | jQuery

  1. Use data-{your custom attribute name}
    1. <a data-url="<?php echo admin_url('admin-ajax.php'); ?>">
  2. Get data- value
    1. var url =$(this).data('url');
  3. Edit data- attribute value
    1. newUrl = 'https://excellentprogrammingtricks.blogspot.com/';
    2. $(this).data('url', newUrl );
    3. Inspect option shows old value because it's not dynamically updated. 
  4. So, finally can use multiple data- attribute with different name in tag.

No comments:

Post a Comment


Authentic аnd Excellent

Website

HTML Template

Wordpress Theme

Database applications

OR

Application services?

Excellent Programming Tricks (EPT) || Iftekhar-IT || We develops the Web applications and the WordPress templates. || Excellent Programming Tricks (EPT)

© 2020 Blogger Theme by Iftekhar IT || Excellent Programming Tricks

Execllent Programming Tricks. Powered by Blogger.