CONTROLLING THE FLOW – JAVASCRIPT CONTROL STATEMENTS (Page 1)

All statements are executed line-by-line, one after another, so the JavaScript code is quite static. However, there is a big difference between the JavaScript and HTML codes, since JavaScript has the conditional statement. It tells the browser to execute one or another part of the code depending on Boolean values. How does it work? Using …

Continue reading →

CONTROLLING THE FLOW – JAVASCRIPT CONTROL STATEMENTS

All statements are executed line-by-line, one after another, so the JavaScript code is quite static. However, there is a big difference between the JavaScript and HTML codes, since JavaScript has the conditional statement. It tells the browser to execute one or another part of the code depending on Boolean values. How does it work? Using …

Continue reading →

BEGINNING JAVASCRIPT PART 5 – THE SELECT ELEMENTS (Page 1)

The SIZE attribute of the <SELECT> tag is used to specify how many of the options are visible to the user. For example, to create a list box that is 5 rows deep and populate it with 7 options, our <SELECT> tag would look like this: <SELECT NAME=theDay SIZE=5> <OPTION VALUE=0 SELECTED>Monday <OPTION VALUE=1>Tuesday <OPTION …

Continue reading →

BEGINNING JAVASCRIPT PART 5 – THE SELECT ELEMENTS

The SIZE attribute of the <SELECT> tag is used to specify how many of the options are visible to the user. For example, to create a list box that is 5 rows deep and populate it with 7 options, our <SELECT> tag would look like this: <SELECT NAME=theDay SIZE=5> <OPTION VALUE=0 SELECTED>Monday <OPTION VALUE=1>Tuesday <OPTION …

Continue reading →

BEGINNING JAVASCRIPT PART 4 – TEXTAREA ELEMENT (Page 1)

However, unlike the text box, the textarea element has its own tag, the <TEXTAREA> tag. It also has two additional attributes: COLS and ROWS. The COLS attribute defines how many characters wide the textarea will be and the ROWS attribute defines how many character rows there will be. Setting the text inside the element is …

Continue reading →

BEGINNING JAVASCRIPT PART 3 – TEXT ELEMENTS (Page 2)

How It Works Within the body of the page, we create the HTML tags that define our form. Inside our form, which is called form1, we create the three form elements with names txtName, txtAge, and butCheckForm. <FORM NAME=form1> Please enter the following details: <P> Name: <BR> <INPUT TYPE=”text” NAME=txtName onchange=”txtName_onchange()”> <BR> Age: <BR> <INPUT …

Continue reading →

BEGINNING JAVASCRIPT PART 4 – TEXTAREA ELEMENT

However, unlike the text box, the textarea element has its own tag, the <TEXTAREA> tag. It also has two additional attributes: COLS and ROWS. The COLS attribute defines how many characters wide the textarea will be and the ROWS attribute defines how many character rows there will be. Setting the text inside the element is …

Continue reading →

BEGINNING JAVASCRIPT PART 3 – TEXT ELEMENTS

A text box is created using the <INPUT> tag, much as our button was, but by setting the TYPE attribute to text. Again, you can choose not to include the VALUE attribute, but if you do include it, then this value will appear inside the text box when the page is loaded. In the example …

Continue reading →