Reputation: 35
I want to create a Hyperlink using Jquery with name "Dashboard" and then add label beside hyperlink with name " >> Category".
So, basically my string would be like " Dashboard >> Category " with dashboard underlined.
How can I do this using Jquery ?
Upvotes: 0
Views: 43
Reputation: 8240
var link = $('<a>Dashboard</a>')
.appendTo($('body'));
$('<label> >> Category</label>').insertAfter(link);
But as David Thomas points out, label is probably not the best tag to use for this. Try <span>
instead.
var link = $('<a>Dashboard</a>')
.appendTo($('body'));
$('<span> >> Category</span>').insertAfter(link);
Upvotes: 2