JAVASCRIPT/JQUERY
Hello I would like some help understanding jQuery.
Here are the directions:
Write a program that creates the following table:
Course |
Course Name |
Day |
Time |
IMS115 |
Windows 10 |
Monday |
6 PM |
IMS215 |
Office 2016 |
Wednesday |
5 PM |
MIS200 |
Java |
Thursday |
9 AM |
MTH105 |
Business Math |
Saturday |
10 AM |
Using jQuery, select every other odd row and change the font color to blue and make it bold.
And here is my code:
Chapter4.html
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="Chapter4.css">
<h1>
Java Script Homework Chapter 4
</h1>
</head>
<body>
<table>
<tr>
<th>Course</th>
<th>Course Name</th>
<th>Day</th>
<th>Time</th>
</tr>
<tr>
<th>IM115</th>
<th>Windows10</th>
<th>Monday</th>
<th>6 PM</th>
</tr>
<tr>
<th>IM215</th>
<th>Office2016</th>
<th>Wednsday</th>
<th>5 PM</th>
</tr>
<th>MIS200</th>
<th>Java</th>
<th>Thursday</th>
<th>9 AM</th>
</tr>
<tr>
<th>MTH105</th>
<th>Business Math</th>
<th>Saturday</th>
<th>10 AM</th>
</tr>
</table>
<script
src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"
integrity="sha256-xNjb53/rY+WmG+4L6tTl9m6PpqknWZvRt0rO1SRnJzw="
crossorigin="anonymous"></script>
<script>
$(document).ready(function(){
$('tr:odd').css({color:'blue',fontWeight:'bold'});
});//end ready
</script>
</body>
</html>
Chapter4.css
@charset "utf-8";
table,th{
border:1px solid black;
}
Everything is in the same folder
C:\Users\************\Desktop\HTMLCSS JAVASCRIPT\HW5
Thank you
Explanation: The problem is that youre placing the script inside the body of html code. You have to place it in the head of html code. And i think the source path give by you is also invalid. So i have changed the source path as well. Now, Its working fine.
Code:
<!DOCTYPE html>
<html>
<head>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("tr:odd").css({"color": "blue","font-weight":"bold"});
});
</script>
</head>
<link rel="stylesheet" href="Chapter4.css">
<h1>
Java Script Homework Chapter 4
</h1>
</head>
<body>
<table>
<tr>
<th>Course</th>
<th>Course Name</th>
<th>Day</th>
<th>Time</th>
</tr>
<tr>
<th>IM115</th>
<th>Windows10</th>
<th>Monday</th>
<th>6 PM</th>
</tr>
<tr>
<th>IM215</th>
<th>Office2016</th>
<th>Wednsday</th>
<th>5 PM</th>
</tr>
<th>MIS200</th>
<th>Java</th>
<th>Thursday</th>
<th>9 AM</th>
</tr>
<tr>
<th>MTH105</th>
<th>Business Math</th>
<th>Saturday</th>
<th>10 AM</th>
</tr>
</table>
</body>
</html>
Css:
@charset "utf-8";
table,th{
border:1px solid black;
}
Ouput:
JAVASCRIPT/JQUERY Hello I would like some help understanding jQuery. Here are the directions: Write a program...
Hello Ive been tryting to add the CDN of jquery to my html code and I keep getting an error Need help with this : Navigate to www.code.jquery.com in your Chrome browser. On this page, you'll find different stable versions of jQuery. Select uncompressed for jQuery Core 3.3.1. Copy the <script> tag that is given to you. In store_hours.html, paste that tag directly above your body's closing tag. This is the jQuery CDN. After you paste this code into...
How do I make these sheets into three different tabs for one website? This is all using HTML. - Chade's Bicycle Company <!DOCTYPE html> <html> <head> <img src="Chade'sLogo.png"> </head> <body bgcolor= "white"> <center> Welcome to Chade's Bicycle Company!</center> <center> We aim towards making our customers happy. </center> <br> <center> Chade's Bicycle Company </center> <center>2900 Bicycle Ave.</center> <center>Seattle, Washington</center> <center>98101</center> <br> <center><img src="HappyCustomer.png" alt="Satisfied customers"></center> <br> <p align="right">Our mission statement:</p> <p align="right">Bicycles have always been a </p> <p align="right">positive part of...
I need help writting a Javascript function that does the following its for a HTML/CSS Shopping Cart Page CODE This page contains a list of the selected products that includes an image, name, price, quantity, and cost) Because the process is implemented not as real, three products along with its image and price are displayed on the page. The product ID of each product is stored in a hidden textbox. The default amount of each product is 1 and the...
I need HELP to get the code to do these function: If I keep clicking "Generate" multiple times, the list keeps on getting bigger. The number of rows should always be equal to the number of columns. Also make the code to show both table at the same time? Here is the code I got some far : Code: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <title>Testing</title> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous"> </head> <style> td...