Home > DeveloperSection > Forums > How can I add text link in a div using jquery?
Garry Winogrand
Garry Winogrand

Total Post:24

Points:168
Posted on    October-05-2013 9:11 AM

 JQuery JQuery 
Ratings:


 1 Reply(s)
 976  View(s)
Rate this:

I want to place text 'Mindstick' with hyperlink <a href="http://www.mindstick.com" inside a div having class-id as "my-link".

How can this be done using jquery or javascript?



Dag Hammarskjold
Dag Hammarskjold

Total Post:24

Points:168
Posted on    October-05-2013 9:29 AM

You can do this :

$('.my-link').html('<a href="http://www.mindstick.com">Mindstick</a>');

But it would add hyperlink to all .my-link divs, so it's better to add an ID to div and use the ID on jQuerycode.

 


Don't want to miss updates? Please click the below button!

Follow MindStick