//Sample Solution to script.js
$(document).ready(function() {
$('#changeButton').click(function() {
//create a new link, using either syntax
$myNewLink = $('<a />');
//add a 'href' attribute of '/links' using .attr()
$myNewLink.attr('href','/links');
//set the html of the link to 'click here!'
$myNewLink.html('click here!');
//set the class of the link to 'important'
$myNewLink.attr('class','important');
//code to add the link to the page... you'll
//learn to do this very soon!
$('body').append($myNewLink);
});
});
No comments:
Post a Comment