The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Prepend Jquery and PHP

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #33491

    I want to write in multi divs with the same class and give different ‘rel’ to the link inside that div.


    $(this).prepend("" class="info" href="#">info";

    but not working :

    anyone can help-me? thanks


    you mean from within a loop?

    Then you should do something like this:


    The php is not executed if you loop it using jquery, so either you should loop from javascript, or from php; so in the above example, your rendered page will have 10 javascript statements, below is just one doing thesame thing.

    for(var i = 0; i < 10; i++) {
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.