Forum : alignment of code
Brief description  about Online courses   join in Online courses
View Siddiqui Nadeem Ahmed 's Profile

alignment of code

Hi sir, First of all I m really very sorry sir for not submitting the assignment on time but i tried to get but i m unable to place the code perfectly i mean that some code is in head tag and the other parts in the body tag

<html>
<head>
<title> this is first

assignment..</title>
<script type="javascript">
document.write("Hello world");
<INPUT TYPE = Button VALUE = "first

color" Onclick = "document.bgColor =

'blue'">



alert(document.title="this is the

first assignment ");
var monthday = now.getDate();
var hour = now.getHours();
var minute = now.getMinutes();
var second = now.getSeconds();
</script>
</head>
<body>

<INPUT TYPE = Button VALUE = "second

color" Onclick = "document.bgColor =

'green'">

<INPUT TYPE = Button VALUE = "first

color" Onclick = "document.bgColor =

'red'">
<INPUT TYPE = Button VALUE = "font

color" Onclick = "document.fgColor =

'green'">
A school is an institution designed

for the teaching of students (or

"pupils") under the supervision of

teachers. Most countries have

systems of formal education, which

is commonly compulsory. In these

systems, students progress through a

series of schools. The names for

these schools vary by country

(discussed in the Regional section

below), but generally include

primary school for young children

and secondary school for teenagers

who have completed primary

education.
In addition to these core schools,

students in a given country may also

attend schools before and after

primary and secondary education.

Kindergarten or pre-school provide

some schooling to very young

children (typically ages 3–5).

University, vocational school,

college or seminary may be available

after secondary school. A school may

also be dedicated to one particular

field, such as a school of economics

or a school of dance. Alternative

schools may provide nontraditional

curriculum and methods.
There are also non-government

schools, called private schools.

Private schools may be for children

with special needs when the

government does not supply for them;

religious, such as Christian

schools, hawzas, yeshivas, and

others; or schools that have a

higher standard of education or seek

to foster other personal

achievements. Schools for adults

include institutions of corporate

training and Military education and

training.


</body>
</html>
Asked by Siddiqui Nadeem Ahmed | Sep 17, 2010 |  Reply now
Replies (1)
View teacher siliconindia 's Profile
Hi Siddiqui,

if u are calling the JS, then write the code inside head section and make it as function... if u want to directly run the JS, then write in body section... But while writing in body, embed HTML tags inside document.write() method. check the modified code below,

<html>
<head>
<title> this is first

assignment..</title>

</head>
<body>

<script language ="javascript" type="text/javascript">


document.write("Hello world");

document.write("<INPUT TYPE = Button VALUE = \"firstcolor\" Onclick = \"document.bgColor ='blue'\" >");

alert(document.title="this is the first assignment");

var monthday = now.getDate();
var hour = now.getHours();
var minute = now.getMinutes();
var second = now.getSeconds();

</script>

<INPUT TYPE = Button VALUE = "secondcolor" Onclick = "document.bgColor ='green'">

<INPUT TYPE = Button VALUE = "firstcolor" Onclick = "document.bgColor ='red'">
<INPUT TYPE = Button VALUE = "fontcolor" Onclick = "document.fgColor ='green'">
A school is an institution designed for the teaching of students (or "pupils") under the supervision of teachers. Most countries have systems of formal education, which is commonly compulsory. In these systems, students progress through a

series of schools. The names for

these schools vary by country

(discussed in the Regional section

below), but generally include

primary school for young children

and secondary school for teenagers

who have completed primary

education.
In addition to these core schools,

students in a given country may also

attend schools before and after

primary and secondary education.

Kindergarten or pre-school provide

some schooling to very young

children (typically ages 3�5).

University, vocational school,

college or seminary may be available

after secondary school. A school may

also be dedicated to one particular

field, such as a school of economics

or a school of dance. Alternative

schools may provide nontraditional

curriculum and methods.
There are also non-government

schools, called private schools.

Private schools may be for children

with special needs when the

government does not supply for them;

religious, such as Christian

schools, hawzas, yeshivas, and

others; or schools that have a

higher standard of education or seek

to foster other personal

achievements. Schools for adults

include institutions of corporate

training and Military education and

training.


</body>
</html>
Sep 19, 2010