Call
whatsapp
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
Cisco Training in Trivandrum, Trinity Technologies

No.1 Training Institute in Kerala

JQuary - QUESTIONS : PART 5

What will be the output of the following Javascript code?

<script>
var str = "The rain in Spain";
var patt1 = /ain/g;
document.write(patt1.lastIndex);
</script>
 

8

17
14
10

SHOW ANSWER

What will be the output of the following Javascript code?

<p id="demo"></p>
<script>
function myFunction() 
{
   var str = "\nIs th\nis it?";
   var patt1 = /^is/m;
   var result = str.match(patt1);
   document.getElementById("demo").innerHTML = result;
}
</script>
 

IS
is
Error
Undefined

SHOW ANSWER

What will be the output of the following Javascript code?

<p id="demo"></p>
<script>
function myFunction() 
{
   var str = "Hellooo World!"; 
   var patt1 = /o+/g;
   var result = str.match(patt1);
   var count=0;
   While(result[i]!=NULL)
   {
       If(result[I]==o)
       count++;
   }
   document.getElementById("demo").innerHTML = count;
}
</script>
 

4
3
1
0

SHOW ANSWER

What will be the output of the following Javascript code?

<p id="demo"></p>
<script>
function myFunction() 
{
    var str = "Is this his";
    var patt1 = /is$/g;
    var result = str.match(patt1);
    if(result)
      result='true';
    else
    result='false';
    document.getElementById("demo").innerHTML = result;
}
</script>
 

true
false
error
undefined

SHOW ANSWER

jQuery is a

JavaScript Library
JavaScript Language 
JavaScript Method 
PHP Method

SHOW ANSWER

jQuery uses CSS selectors to select elements?

False
True

SHOW ANSWER

With jQuery, look at the following selector: $("div"). What does it select?

All div elements
The first div element

SHOW ANSWER

The jQuery html() method works for both HTML and XML documents

False
True

SHOW ANSWER

What is the correct jQuery code to set the background color of all p elements to red?

$("p").layout("background-color","red");
$("p").manipulate("background-color","red");
$("p").css("background-color","red");
$("p").style("background-color","red");

SHOW ANSWER

Which jQuery method is used to set one or more style properties for selected elements?

css()
html()
style()

SHOW ANSWER

Which statement is true?

To use jQuery, you must buy the jQuery library at www.jquery.com
To use jQuery, you do not have to do anything. Most browsers (Internet Explorer, Chrome, Firefox and Opera) have the jQuery library built in the browser

To use jQuery, you can refer to a hosted jQuery library at Google

SHOW ANSWER

What scripting language is jQuery written in?

VBScript
JavaScript
C#
C++

SHOW ANSWER

Which jQuery function is used to prevent code from running, before the document is finished loading?

$(document).load()
$(document).ready()
$(body).onload()

SHOW ANSWER
BACK | NEXT
TRINITY SOFTWARE SOLUTIONS,IInd floor, Radheyam Towers, Gandhari Amman Kovil Road, Pulimood, Trivandrum - 1
0471-2334855 | 2335855 | 9447387064 | 9847003556 info@trinitytechnology.in