You are on page 1of 1

QN.1.List out the different ways on HTML element can be accessed in java script code.

Answer:

(i).getElementById(‘idname’):

-Get element by IDname

(ii).getElementByClass(‘classname’):

-Get all elements that have given class name.

(iii).getElementByTagName(‘tagname’)

-Gets all elements that have the given tag name.

(iv).querySelector():

-This function takes ccs style selector and returns the first selected element.

QN.2.What is subroutine? and give example program.

QN.3.Give PUSH and POP methods with example.

QN.4.Unshift and shift.

QN.5.Sort.

QN.6. Cookies? in a java script and give example.

You might also like