Uploaded by asifmahmud9870

Group-Assignment 201902052 201902049

advertisement
Green University of Bangladesh
Department of Computer Science and Engineering(CSE)
Faculty of Sciences and Engineering
Semester: (Spring, Year:2021), B.Sc. in CSE (Day)
Group Assignment
Course Title: Web Programming
Course Code: CSE 301
Section:C
Student Details
Name
ID
01.
MD. Jaddal Hasan
201902052
02.
Asif Mahmud
201902049
Submission Date
Course Teacher’s Name
: 15-05-2022
: Abu Rafe Md. jamil
01. What does this do?
document.getElementById("main").appendChild(document.createElement("p").appendChild(doc
umentCreateTextNode("Hey, I'm walking here!") ) );
Ans: It creates a new text node that says, "Hey, I'm walking here!", inserts it in a newly created p
element, and puts the new p element in the element with the id "main".
02. What will each of these alert messages say?
a.
var foo = 5;
foo += 5;
alert( foo );
Ans: 10
b.
i = 5;
i++;
alert( i );
Ans: 6
c.
var foo = 2;
alert( foo + " " + "remaining");
Ans: "2 remaining"
d.
var foo = "Mat";
var bar = "Jennifer";
if( foo.length > bar.length ) {
alert( foo + " is longer." );
} else {
alert( bar + " is longer." );
}
Ans: "Jennifer is longer"
e.
alert( 10 === "10" );
Ans: false
03. What will the be the output of the following php code<?php
$value = 5;
echo $value;
echo "<br />";
echo $value+++$value++;
echo "<br />";
echo $value;
echo "<br />";
echo $value---$value--;
echo "<br />";
echo $value;
?>
Ans: 5
11
7
1
5
Download