0
I’m wearing a shortcode in Wordpress that only gives me the possibility to insert the following attributes:
<a href="#anatomia" target="_self" class="dt-sc-button small">Inscreva</a>
<a href="#anatomia" target="_self" class="dt-sc-button small">Saiba mais</a>
I’d like to take the attribute then href
and insert it as the element’s ID. Since there may be more than one element (7 to begin with), I thought I’d put it into one foreach
to repeat this for all elements.
Another thing ... I thought I’d use the class dt-sc-button
to restrict the application to these elements.
$('.dt-sc-button'). each(Function(){ this.id = $(this). attr('href'). Slice(1); }); <- I think this will do the trick
– Sergio
Why you need to insert Ids into these elements?
– user6476
To make different calls for each course. Different price, different date and location etc ...
– Marcos Vinicius