You must Sign In to post a response.
  • Category: JQuery

    How to add title in anchor tag using jquery

    Hi ,
    I want to add a title in anchor tag using jquery
    my following code is not showing title

    $(this).append("<a class='anchor3' title='already booked' id='" + fcelltext + "-" + hdtext + "' href='#' >" + name + "</a>");
    after this code i added following code
    $("a").attr('title', 'booked');
    this is not working
    how to solve this

    Regards
    Baiju
  • #769351
    Hi Baiju

    Try the below code it will work for you.

    $(this).append("<a class='anchor3' title='already booked' id='" + fcelltext + "-" + hdtext + "' href='#' >" + name + "</a>");
    after this code i added following code
    $(".anchor3").attr('title', 'booked');// here you should specify that particular anchor tag
    by taking its class name we are selecting that anchor,
    then applying the attribute title.

    Sridhar Thota.
    Editor: DNS Forum.


  • Sign In to post your comments