1 Reply Latest reply on May 1, 2014 3:10 AM by try67

    handling returned value(onclick action of anchor tag ) when html is in string format

    shashikala

      Hi,

       

       

      I have an anhor tag which is in string format that is str=str+ '<a onclick=\'myFunction("'send'")\' href="#">hello</a>';

      now on click it goes to myFunction("send"), now I want myFunction to return a value ,and based on returned value i want certain action to be carried,

      myFunction(send)

      {

      //doSomethting

      return Value;

      }

      function mainFunction()

      {

      str=str+ '<a onclick=\'myFunction("'send'")\' href="#">hello</a>';

      //handling the returned value of onclick

      if(Value == "correct")

      { // do something }

      else

      { //other action }

       

       

      }

       

       

       

       

      I will be grateful if someone can provide a working example of the above scenario which I want to implement.

      Regards,

      Lakshmi