a. Alternative row colortable using ClassName b. Input validation and error mess
ID: 3610189 • Letter: A
Question
a. Alternative row colortable using ClassName
b. Input validation and error message
c. Hide on mouseover, show on mouse out
1 For item a, create a 10 rows by 3 column HTML table.
2. Then create two CSS rules called odd and even for whichodd’s background color is white an even’s isyellow.
3. Next register a JavaScript function called ApplyAlternateRowswith the onload event that iternates through the rows of
the tables and applies theodd class to every odd table row and even class to every even tablerow
Hint: Get a handle on thetable object and iterate through its rows. Use the objects lengthand rows[] properties.
1. For item b, create aform with a single input field and a regular HTML button right nextto it with a value of Validate.
2. Then register a JavaScript function called CheckNumeric with thebutton’s onclick event which ensures checks if the
input is not numeric, itdisplays a message to the right of the button in red.
Hint: Use the function provided below to check if the input isnumeric or not.
function IsNumeric(sText){
var ValidChars = "0123456789.";
var IsNumber=true;
var Char;
for (i = 0; i < sText.length && IsNumber == true;i++){
Char = sText.charAt(i);
if (ValidChars.indexOf(Char) == -1){
IsNumber = false;
}
}
return IsNumber;
}
Explanation / Answer
<table class="content">
<caption>Example Table with Alternating RowColors</caption>
CSS rules
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.