I am having a HTML like
<a href="yourpath/controller/views/username" class="classname">username</a>
How to read the attribute href
's value by classname using the Prototype.js.
Ple开发者_开发百科ase give some suggestions.
$$('.classname')[0].readAttribute('href');
Note that $$
will always return an array.
$$('.classname').pluck('href');
This will return an array of href
values in case you need more than one.
$$('.className')[0].readAttribute('href')
精彩评论