Forums

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
    Posts
  • #33491
    tiagoroldao
    Member

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

    jquery:

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

    but not working :

    anyone can help-me? thanks

    #83204
    fbroersen
    Member

    you mean from within a loop?

    Then you should do something like this:


    $(this).prepend('">link');

    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++) {
    $(this).prepend('link');
    }
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.