solutions
Write a multi-line javascript comment that contains name and home town -
ANSWER- /*Jessica Scicchitano Florence SC*/
Write the code to give a variable a value that is your major's name - ANSWER- var
m='biology'
What does the parselnt( ) do? - ANSWER- takes a string value and makes it a
number value
What does padding and margin property specifies in CSS? - ANSWER- Margin:
how much space between each box model
Padding: space between border and text
code for when paragraph element moused over, font size becomes 32 pt -
ANSWER- <p onmouseover="this.style.fontSize='32 pt'"> Heading </p>
Write the CSS rule to define a solid green border with 2px of width for the H1
elements. - ANSWER- h1{border-style:solid, border-color: green, border-width:
2px;}
Using javascript, a.)prompt the user for their first name - ANSWER- var
n=prompt('Please enter your first name')
b.) Prompt the user for their last name - ANSWER- var m= prompt('please enter
your last name')
c.) using the results from part a and b, say hello to the user in an alert box -
ANSWER- alert('Hello" + n+ m)
, Write the code for a function that takes one number as an arguement and alerts
the user if the number is greater than 5 or not - ANSWER- <script> {function
numb(n1) if (n1>5)
alert (n1+ 'is greater than 5')
else
alert(n1+ 'is not greater than 5')
</script>
write a function that takes two arguments which are id's of two paragraph
elements. This function should change the text color of the first paragraph to
green and the background of the second paragraph to red. - ANSWER- <script>
{function change (alb)
document.getElementById(a).style.color='green'
document.getElementById(b).style.background color='red'}
<p id="para 1" onclick="_________">text 1</p>
<p id="para 2"> text2 </p> - ANSWER- change('para1','para2')
Write code to create the first row of the following table. Start writing code with the
<table> tag and stop after writing enough code to create only the first row of the
table - ANSWER- <table>
<tr>
<th rowspan="3"> USC </th>
<th colspan="2"> CSCE102</th>
</tr>
After the following code has been executed :
var x="7" ; var y="8"; var z=x+y;
What is the vale of variable z? and what is the data type of the variable z? -
ANSWER- 78; string
After the following is executed, what would be the value of the variables m and n?
var m=9; var n=5; m=m +n ;
m= m%n; n=3; - ANSWER- m= 4, n=3
Write a function with no arguments that prompt the user to enter a number and
whether the number entered is even or odd, shows an alert box with a relative
message - ANSWER- <script>
{function number( )
var x= prompt('enter a number')
if (parseln +(x)%2=0)