HTML CODE:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Practice</title>
<script src="my.js"></script>
<link rel="stylesheet" href="my.css" />
</head>
<body>
<h1>Practice Page</h1>
<p>click on ^ to show am
<code class="js">alert()</code>.</p>
<p id="hoverable">Put your mouse here to make every paragraph red <code class="html"><p></code> get the class
<code class="h">highlighted</code></p>
I have imported a jquery file already with another which isn't included here, and my current javascript code is as follows:
head = function() {
alert("I'm a heading");
}
redtext=function(){
$('hoverable').attr("#hoverable","#highlighted");
}
setup = function() {
jQuery('h1').click(head);
jQuery('p').mouseover(red);
}
jQuery(document).ready(setup)
With my css code being:
.highlighted {
color: red;
}
I'm trying to make it so when ever i highlight over the hoverable id, all the paragraphs turn red, so the new id would be highlighted for all the paragraphs, I tried changing the id, but i can't seem to get it to work