user1015214
user1015214

Reputation: 3091

jquery code not making links link

I have the following jquery code:

$(document).ready(function() {
$("body[class*=page-calendar-practices] #content-header h1#title").after("<div id='athletics_practice-schedule'><div id='inner-title'><a href='www.example.com' class='athletics_links'>GAMES</a><a href='www.example.com/games' class='athletics_links'>PRACTICES</a></div></div>");

});

This code creates the anchor links on the page as it should, but (in at least Google Chrome) they don't show up as links, just as text. Why is this?

Upvotes: 1

Views: 49

Answers (1)

Blazemonger
Blazemonger

Reputation: 93003

Possibly because they're not proper URLs? You need to add "http://" before the domain name for an absolute URL.

http://jsfiddle.net/X3399/1/ -- Your code actually works fine, but the links don't point where you probably expected them to point.

Upvotes: 4

Related Questions