Hello! Could someone help me out how to create a link with just using JC. Its needs to be attached to the end of the fourth <p> that comes from the second <div> and it shall show <p class"shower"> that is hidden. I have tried a few things and failed hard. Sadly i cant find it on youtube either. Some help would be really appreciatet :)
10-30-2012, 05:12 PM
cbVision
Here's an example of how to add a link to the fourth paragraph of the 2nd div: http://jsfiddle.net/AtRxG/
10-30-2012, 05:24 PM
Vraith11
Thank you for the reply mate. But sadly i am not allowed to use jQuery ;(
10-30-2012, 05:29 PM
cbVision
Why not? Is it homework?
10-30-2012, 05:30 PM
Vraith11
jepp. Love that the teacher gives assigments that we even havent gotten too. Started JC 2 days ago. Just learned what document.getElementByID() is :P. haha. Distance course
10-30-2012, 05:45 PM
cbVision
Alrighty, well I hope you learn something from my example then :)
Basically, I'm getting the elements by the tag name (div and p). This will return all the elements in an array, so then I need to tell it which one I want in the square brackets. After I've found the fourthP, I can modify the HTML.