0% found this document useful (0 votes)
11 views

Css t2

Form is used to collect user input using controls like text fields and text areas. JavaScript can be used to validate form data in the browser. Rollover effects change the appearance of an element when the mouse moves over it to improve the user experience. The window.location and window.history objects provide properties and methods to work with URLs. The setTimeout() function allows scheduling a function to run after a delay. HTML form elements can be disabled by setting the disabled property to true and re-enabled by setting it to false.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Css t2

Form is used to collect user input using controls like text fields and text areas. JavaScript can be used to validate form data in the browser. Rollover effects change the appearance of an element when the mouse moves over it to improve the user experience. The window.location and window.history objects provide properties and methods to work with URLs. The setTimeout() function allows scheduling a function to run after a delay. HTML form elements can be disabled by setting the disabled property to true and re-enabled by setting it to false.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

a.

Explain two uses of form


1) Form is an HTML elements which takes the user input using various
controls like text filed, textarea etc.
2) Data can be validated on the client browser using the JavaScript

b. What is rollover
We can change the appearance of web page by using mouse rollover when
mouse is moved to any element of web page the appearance of dead
element will be changed it also called as mouse over , rollover is used to
improve user expereance and quality of web pages.

c. list properties of window location and history


properties of window location :
window.location.host
window.location.href
window.location.pathname
window.location.hostname
History : the window.history object contains the record of URLs visited by
the user within a browser is a part of the window object so that it is
accessed by window.history

d. What is the use of setTimeout() function


A setTimeout() function allows you to schedule a specified function to
trigger at a specific time from the current time

e. How to disable particular element on the form


Sometimes we need to enabled and disabled input elements like text box ,
radio buttons , check box but every time we make a change we need to
reload the HTML page an element can be disabled in HTML by setting
disable property to true and enabled again by setting disabled = false
a. Write a Java Script code to open a new window
<html>
<head>
<script type = “text/javascript”>
Function open Window() {
Window.open(“”,””,”width= 200, height=100”);
}
</script>
</head>
<body>
<p> Click to open a new window </p>
<input type = “button” value= “open new window” onclick =
“openWindow()”/>
</body>
</html>
b. What is the method of setting expire date of cookie
We can extend the life of a cookie by setting a new expiration date to the
cookie. This can be done by setting the ‘expires’ attribute to a new date and
time. The date has following function to get the month of the date to set
the month of the date and to format the date string
getMonth() : this function returns the month of the current date object
setMonth(): this function set the month to the current date object
toUTCString(): this function formats the date in standard format to set the
expiration date of the cookie.

c. Explain any four commonly used methods in regular expression


Compile(): Deprecated in version 1.5 compiles a regular expression
Test(): Tests for a match in string return true or false
toString(): Returns the string value of the regular expression
exec(): Tests for a match in string returns the first match

d. How will you create password field in HTML form


The <input> tag with a type="password" attribute creates a text field where
users can securily enter a password. As characters are entered, they are
replaced by a dot ("•") or asterisk ("*") symbol

You might also like