Javascript Question and Answer
Javascript Question and Answer
71. <script type="text/javascript" language="javascript">
var qpt = "QualityPointTechnologies";
var result =qpt.indexOf("Tech");
document.write(result);
</script>
var qpt = "QualityPointTechnologies";
var result =qpt.indexOf("Tech");
document.write(result);
</script>
- 11
- 12
- 15
- 13
72. <script language="javascript">
function x()
{
var s = "Eat to live, but do not live to eat";
var pattern = new RegExp("eat$");
document.write(pattern.exec(s));
}
</script>
function x()
{
var s = "Eat to live, but do not live to eat";
var pattern = new RegExp("eat$");
document.write(pattern.exec(s));
}
</script>
- Eat
- eat
- undefined
- Eat eat
73. <script language="javascript">
function x()
{
var qpt = "We are fast growing Software Company located in Chennai, India.";
var pattern = new RegExp("in","g");
document.write(pattern.exec(qpt) + " ");
document.write(pattern.exec(qpt) + " ");
document.write(pattern.exec(qpt) + " ");
}
</script>
function x()
{
var qpt = "We are fast growing Software Company located in Chennai, India.";
var pattern = new RegExp("in","g");
document.write(pattern.exec(qpt) + " ");
document.write(pattern.exec(qpt) + " ");
document.write(pattern.exec(qpt) + " ");
}
</script>
- in in In
- in in in
- in in null
- in null null
74. -------------- method is used to remove focus from the specified object.
- blur()
- focus()
- None
77. <script language="javascript">
function x()
{
var qpt = "QualityPointTechnologies";
var pattern = new RegExp("TECHNOLOGIES","i");
document.write(qpt.match(pattern));
}
</script>
function x()
{
var qpt = "QualityPointTechnologies";
var pattern = new RegExp("TECHNOLOGIES","i");
document.write(qpt.match(pattern));
}
</script>
- null
- Technologies
- TECHNOLOGIES
- Error