Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('a.testingCase[title]').each(function() {
- var $t = $(this);
- $t
- .attr({
- newTitleName : $t.attr('title'),
- })
- .removeAttr('title')
- ;
- });
- /* get all <a> with a "title" attribute that are testingCase
- then apply an anonymous function on each of them */
- $('a.testingCase[title]').each(function() {
- /* create a jquery object from the <a> DOM object */
- var $a_with_title = $(this);
- /* add the new attribute with the title value */
- $a_with_title.attr("newTitleName", $a_with_title.getAttribute('title'));
- /* remove the old attribute */
- $a_with_title.removeAttr('title');
- });
Add Comment
Please, Sign In to add comment