0% found this document useful (0 votes)
33 views5 pages

UT 2 Answer Paper

Uploaded by

are93776
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views5 pages

UT 2 Answer Paper

Uploaded by

are93776
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

Ahmednagar Jilha Maratha Vidya Prasarak Samaj’s

Shri Chhatrapati Shivaji Maharaj


College of Engineering, Nepti, Ahmednagar
Survey No. 162 & 163, Nepti, Nagar-Kalyan Road, Ahmednagar- 414005 (Maharashtra)

E-Mail:1953principal@msbte.com MSBTE Inst. Code: - 1953 Tel. No. 0241-2568383 Fax:


principal@scoea.org DTE Code: - EN 5382 0241-2568384
Website: www.scoea.org
Approved by AICTE New Delhi, Govt. of Maharashtra & Recognized by DTE Mumbai & Affiliated to MSBTE,
Mumbai.

Class Test-I
Subject Name: CSS Model Answer Subject Code: 22519

Q. Sub Marking
Answer
No Q.N Scheme

1 A) Attempt any FOUR of the following 08

1 How to create password Field in HTML form? 02


The elements of type password provide a way for the user to securely enter a
password. The element is presented as a one-line plain text editor control in
which the text is masked so that it cannot be read, usually by replacing each
character with a symbol such as the asterisk ("*") or a dot ("•").
2 What is cookies? 2
A cookie is a small text file that a web site saves on your PC, mobile phone or
other device, containing information about your browsing on that site. Cookies
are necessary to facilitate browsing and make it more convenient; they do not
harm your computer.
3. What is event? 02
The change in the state of an object is known as an Event. Event is something that causes JavaScript
to execute the code. JavaScript's interaction with HTML is handled through events that occur when
the user or the browser manipulates a page. Examples of events are page loads, clicks a mouse button,
pressing any key, closing a window, resizing a window, etc.
4 Enlist and explain the use of any two intrinsic Javascript functions? 02
An intrinsic function (or built-in function) is a function (subroutine) available for use in a given
programming language whose implementation is handled specially by the compiler.  “Intrinsic” is
also called as “built-in”.

isNaN():-
This method determines whether value of a variable is a legal number or not. For example
document.write(isNan(0)); //false document.write(isNan('JavaScript'));

eval():-
eval() is used to execute Javascript source code. It evaluates or executes the argument passed to it
and generates output.
For example eval("var number=2;number=number+2;document.write(number)");

1
Ahmednagar Jilha Maratha Vidya Prasarak Samaj’s
Shri Chhatrapati Shivaji Maharaj
College of Engineering, Nepti, Ahmednagar
Survey No. 162 & 163, Nepti, Nagar-Kalyan Road, Ahmednagar- 414005 (Maharashtra)

E-Mail:1953principal@msbte.com MSBTE Inst. Code: - 1953 Tel. No. 0241-2568383 Fax:


principal@scoea.org DTE Code: - EN 5382 0241-2568384
Website: www.scoea.org
Approved by AICTE New Delhi, Govt. of Maharashtra & Recognized by DTE Mumbai & Affiliated to MSBTE,
Mumbai.

5 Enlist and explain the use of any two intrinsic Javascript functions? 02
An intrinsic function (or built-in function) is a function (subroutine) available for use in a given
programming language whose implementation is handled specially by the compiler.  “Intrinsic” is
also called as “built-in”.

isNaN():-
This method determines whether value of a variable is a legal number or not. For example
document.write(isNan(0)); //false document.write(isNan('JavaScript'));

eval():-
eval() is used to execute Javascript source code. It evaluates or executes the argument passed to it
and generates output.
For example eval("var
number=2;number=number+2;document.write(number)");
6 State and explain what is session cookies? 02
Session Cookies : Session cookies is a cookie that remains in temporary memory only
while user is reading and navigating the web site. The cookie is automatically deleted
when the user exits the browser application.

2 Attempt any FOUR of the following 16

1 Write the use of charAt() and indexOf() with syntax and example? 04
CharAt()
It provides the char value present at the specified index.
Syntax String.charAt(index)
Parameter index - It represent the position of a character.
Returns A character.

indexOf()
The JavaScript string indexOf() method is used to search the position of a particular character or
string in a sequence of given char values. This method is case-sensitive. The index position of first
character in a string is always starts with zero. If an element is not present in a string, it returns -1.

Syntax indexOf(ch,index) It start searching the element from the provided index value and then
returns the index position of specified char value. index - It is optional which represent the index
position from where search starts.

2
Ahmednagar Jilha Maratha Vidya Prasarak Samaj’s
Shri Chhatrapati Shivaji Maharaj
College of Engineering, Nepti, Ahmednagar
Survey No. 162 & 163, Nepti, Nagar-Kalyan Road, Ahmednagar- 414005 (Maharashtra)

E-Mail:1953principal@msbte.com MSBTE Inst. Code: - 1953 Tel. No. 0241-2568383 Fax:


principal@scoea.org DTE Code: - EN 5382 0241-2568384
Website: www.scoea.org
Approved by AICTE New Delhi, Govt. of Maharashtra & Recognized by DTE Mumbai & Affiliated to MSBTE,
Mumbai.

2 What is event and form? List various form events. Give use of form? 04
Events:-

The change in the state of an object is known as an Event. Event is something that causes JavaScript
to execute the code. JavaScript's interaction with HTML is handled through events that occur when
the user or the browser manipulates a page. Examples of events are page loads, clicks a mouse
button, pressing any key, closing a window, resizing a window, etc.

Form:-

A form is a section of a document which contains controls such as text fields, password fields,
checkboxes, radio buttons, submit button, menus etc. An HTML form facilitates the user to enter
data that is to be sent to the server for processing such as name, email address, password, phone
number, etc. . We use HTML form element in order to create the JavaScript form.

Uses of form:-

Typical form control objects -- also called "widgets" -- include the following:

 Text box for entering a line of text

 Push button for selecting an action

 Radio buttons for making one selection among a group of options

 Check boxes for selecting or deselecting a single, independent option

3 Write the syntax of and explain use of following methods of javascript.

Timing event. 1) setTimeOut() 2) setInterval()

1) setTimeOut() :- The setTimeout() method of the Window interface sets a timer which
executes a function or specified piece of code once the timer expires.

2)SetInterval():-The setInterval() method of the Window interface repeatedly calls a function or


executes a code snippet, with a fixed time delay between each call.

This method returns an interval ID which uniquely identifies the interval, so you can remove it later
by calling clearInterval().
4 What a javascript that crearte a pressistent cookie of itemname. Write appropriate HTML script for same. 04

3
Ahmednagar Jilha Maratha Vidya Prasarak Samaj’s
Shri Chhatrapati Shivaji Maharaj
College of Engineering, Nepti, Ahmednagar
Survey No. 162 & 163, Nepti, Nagar-Kalyan Road, Ahmednagar- 414005 (Maharashtra)

E-Mail:1953principal@msbte.com MSBTE Inst. Code: - 1953 Tel. No. 0241-2568383 Fax:


principal@scoea.org DTE Code: - EN 5382 0241-2568384
Website: www.scoea.org
Approved by AICTE New Delhi, Govt. of Maharashtra & Recognized by DTE Mumbai & Affiliated to MSBTE,
Mumbai.

<!DOCTYPE html>

<html>

<head>

<script>

function setCookie(cname,cvalue,exdays) {

const d = new Date();

d.setTime(d.getTime() + (exdays*24*60*60*1000));

let expires = "expires=" + d.toUTCString();

document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";

function getCookie(cname) {

let name = cname + "=";

let decodedCookie = decodeURIComponent(document.cookie);

let ca = decodedCookie.split(';');

for(let i = 0; i < ca.length; i++) {

let c = ca[i];

while (c.charAt(0) == ' ') {

c = c.substring(1);

if (c.indexOf(name) == 0) {

return c.substring(name.length, c.length);

4
Ahmednagar Jilha Maratha Vidya Prasarak Samaj’s
Shri Chhatrapati Shivaji Maharaj
College of Engineering, Nepti, Ahmednagar
Survey No. 162 & 163, Nepti, Nagar-Kalyan Road, Ahmednagar- 414005 (Maharashtra)

E-Mail:1953principal@msbte.com MSBTE Inst. Code: - 1953 Tel. No. 0241-2568383 Fax:


principal@scoea.org DTE Code: - EN 5382 0241-2568384
Website: www.scoea.org
Approved by AICTE New Delhi, Govt. of Maharashtra & Recognized by DTE Mumbai & Affiliated to MSBTE,
Mumbai.

5 How to change the content of the window. Explain with example? 04


<!DOCTYPE html>
<html>
<body>

<h1>The Console Object</h1>


<h2>The error() Method</h2>
<p>Remember to open the console (Press F12) before you
click "Run".</p>

<script>
window.console.error("You made a mistake");
</script>

</body>
</html>

You might also like