Professional Documents
Culture Documents
HTML 3
HTML 3
=== Identical $a === Return TRUE if $a is equal to $b, and they are of same
$b data type
!== Not $a !== $b Return TRUE if $a is not equal to $b, and they are not of
identical same data type
2)What is the use of the following CSS selectors ?Explain with examples-
a)class b)#id
Answer:- a) CSS Class Selector :- The class selector selects HTML elements with a
specific class attribute.
To select elements with a specific class, write a period (.) character, followed by
the class name.
Example:-
<!DOCTYPE html>
<html>
<head>
<style>
.center {
text-align: center;
color: red;
</style>
</head>
<body>
</body>
</html>
To select an element with a specific id, write a hash (#) character, followed by
the id of the element.
Example
<!DOCTYPE html>
<html>
<head>
<style>
#para1 {
text-align: center;
color: red;
</style>
</head>
<body>
</body>
</html
3)What is the purpose of audio and video tags in html? Give example.
Answer:- Audio Tag:- HTML audio tag is used to define sounds such as music and other
audio clips. Currently there are three supported file format for HTML audio tag.
1. mp3
2. wav
3. ogg
Example: <!DOCTYPE>
<html>
<body>
<audio controls>
</audio>
</body>
</html>
The text between the <video> and </video> tags will only be displayed in
browsers that do not support the <video> element.
There are three supported video formats in HTML: MP4, WebM, and OGG.
<!DOCTYPE html>
<html>
<body>
Example:-
</video>
</body>
</html>
Method Description
confirm() displays the confirm dialog box containing message with ok and cancel button.
Answer:- a)click()event:- When you click on an element, the click event occurs and
once the click event occurs it execute the click () method or attaches a function to run.
Syntax:
$(selector).click()
b) ready()event:- The ready() function in jQuery executes the code only when the DOM
(Document object model) is fully loaded. It is an inbuilt function in jQuery.
Syntax:- $(document).ready(function)
c)hide()event:- The jQuery hide() method is used to hide the selected elements.
Syntax:
$(selector).hide();