What to use with Jquery for Div html , innerHtml Or text

What to use with Jquery for Div html , innerHtml Or text?

I was working on project which uses Google maps. We allow users to create polygon on the Google map and when user starts drawing polygon we were to show tool tips, you can read how we are showing tooltips using Jquery on teh googel maps here [http://www.isolutionteam.co.uk/show-tooltip-on-google-map-polygon-drag-handle-using-jquery/].

Tool tip were worked great in all three browsers IE 7, Firefox 3.6.4 and Chrome 4.1.249.  Then there was a requirement to change tool tip text on every click of mouse on the map.  This process  involved to count vertices of polygon on the map.

I E was going mad on second click when I was using $(“#maptooltipcontainer”).html(toolTipText). but it worked fine with Firefox and chrome versions mentioned above.
Then i changed $(“#maptooltipcontainer”).text(toolTipText). and it started working on all three browsers.

Tags: , , , , , ,

One Response to “What to use with Jquery for Div html , innerHtml Or text”

  1. marimuthu says:

    i have attached my program code

    Untitled Document

    $(function(){
    $(“#btncricket”).click(function(){
    $(“#divcricket1”).show();
    $(“button”).click(function(){
    var s=this.id;

    call(s);
    });
    });
    });
    function call(s)
    {

    //var d=document.getElementByTagName(‘tblIndia’);
    switch(s)
    {

    case ‘btnIndia’:
    $(“#div3”).html(function(){
    $(“#tblIndia”).show();
    return ‘ INDIAN ‘;
    });
    break;
    case ‘btnPakistan’:
    $(“#divPakistan”).show();
    break;
    }
    function show(s)
    {

    }

    }

    India
    Pakistan
    South Africa
    Srilanka

    sno
    Name

    1.
    Afradi

    2.
    Anwer

    3.
    Insam-Ul-Hug

    4.
    Sami

    5.
    Asif

    sno
    Name

    1.
    Sachin

    2.
    Sourav

    3.
    Dravid

    4.
    Sachin

    5.
    Sachin

    then i click a cricket button then shows divcricket1 and then click india then it will not shown in div3 tag
    i want to use innerhtml so pls help me to rply