Jquery get attribute of few ul to create another attribute

Posted by Josemalive on Stack Overflow See other posts from Stack Overflow or by Josemalive
Published on 2010-03-24T14:42:20Z Indexed on 2010/03/24 14:53 UTC
Read the original article Hit count: 544

Filed under:
|

Hello,

I have the following HTML:

<ul actualpage=0>
<li/>
<li/>
....
</ul>

<ul actualpage=0>
<li/>
<li/>
....
</ul>

Im trying to get the value of actualpage of each ul and create a new attribute. Its easy but not in one jquery sentence... Its possible? Until now i have the following line (between ## simbols the missing part that i need.

    /*
select all uls with attribute actualpage and create a new attribute on each with the current actualpage value
    */

$('ul[actualpage]').attr('newactualpage',##Current value of actualpage attr of UL##);

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript