I am trying to create an anchor link when a user clicks on another link.
When I click on the first link, the onclick event is raised and generates another link using JavaScript, but that is not generated properly.
This is my anchor link in JavaScript:
temp="<li><a href='#' onclick='showMenu3('"+menu2[0]+"','"+menu2[2]+"')'>
<img src='images/noImageSmall.png'/>"+menu2[2]+"</a></li>";
But it is generated in the source as following:
<li><a href="#" onclick="showMenu3(" 139','invite="" a="" friend')'="">
<img src="images/noImageSmall.png">Invite a friend</a></li>
How can I generate the following link using JavaScript?
<li><a href="#" onclick="showMenu3('139','invite friend')">
<img src="images/noImageSmall.png">Invite a friend</a></li>