Scroll Top

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 12

<html>

<head><title>scrollTop program</title>
<style>
#div1
{
background-color:aliceblue;
width:400px;
height:300px;
overflow: auto;

}
</style>
</head>
<body><h3>
scrollTop
</h3><div id="div1">
<p>You must follow any policies made available to you within the Services.

Don’t misuse our Services. For example, don’t interfere with our Services or
try to access them using a method other than the interface and the instructions
that we provide. You may use our Services only as permitted by law, including
applicable export and re-export control laws and regulations. We may suspend or
stop providing our Services to you if you do not comply with our terms or policies
or if we are investigating suspected misconduct.

Using our Services does not give you ownership of any intellectual property
rights in our Services or the content you access. You may not use content from our
Services unless you obtain permission from its owner or are otherwise permitted by
law. These terms do not grant you the right to use any branding or logos used in
our Services. Don’t remove, obscure, or alter any legal notices displayed in or
along with our Services.

Our Services display some content that is not Google’s. This content is the
sole responsibility of the entity that makes it available. We may review content to
determine whether it is illegal or violates our policies, and we may remove or
refuse to display content that we reasonably believe violates our policies or the
law. But that does not necessarily mean that we review content, so please don’t
assume that we do.

In connection with your use of the Services, we may send you service
announcements, administrative messages, and other information. You may opt out of
some of those communications.

Some of our Services are available on mobile devices. Do not use such Services
in a way that distracts you and prevents you from obeying traffic or safety
laws.You must follow any policies made available to you within the Services.

Don’t misuse our Services. For example, don’t interfere with our Services or
try to access them using a method other than the interface and the instructions
that we provide. You may use our Services only as permitted by law, including
applicable export and re-export control laws and regulations. We may suspend or
stop providing our Services to you if you do not comply with our terms or policies
or if we are investigating suspected misconduct.

Using our Services does not give you ownership of any intellectual property
rights in our Services or the content you access. You may not use content from our
Services unless you obtain permission from its owner or are otherwise permitted by
law. These terms do not grant you the right to use any branding or logos used in
our Services. Don’t remove, obscure, or alter any legal notices displayed in or
along with our Services.

Our Services display some content that is not Google’s. This content is the
sole responsibility of the entity that makes it available. We may review content to
determine whether it is illegal or violates our policies, and we may remove or
refuse to display content that we reasonably believe violates our policies or the
law. But that does not necessarily mean that we review content, so please don’t
assume that we do.

In connection with your use of the Services, we may send you service
announcements, administrative messages, and other information. You may opt out of
some of those communications.

Some of our Services are available on mobile devices. Do not use such Services
in a way that distracts you and prevents you from obeying traffic or safety
laws.You must follow any policies made available to you within the Services.

Don’t misuse our Services. For example, don’t interfere with our Services or
try to access them using a method other than the interface and the instructions
that we provide. You may use our Services only as permitted by law, including
applicable export and re-export control laws and regulations. We may suspend or
stop providing our Services to you if you do not comply with our terms or policies
or if we are investigating suspected misconduct.

Using our Services does not give you ownership of any intellectual property
rights in our Services or the content you access. You may not use content from our
Services unless you obtain permission from its owner or are otherwise permitted by
law. These terms do not grant you the right to use any branding or logos used in
our Services. Don’t remove, obscure, or alter any legal notices displayed in or
along with our Services.

Our Services display some content that is not Google’s. This content is the
sole responsibility of the entity that makes it available. We may review content to
determine whether it is illegal or violates our policies, and we may remove or
refuse to display content that we reasonably believe violates our policies or the
law. But that does not necessarily mean that we review content, so please don’t
assume that we do.

In connection with your use of the Services, we may send you service
announcements, administrative messages, and other information. You may opt out of
some of those communications.

Some of our Services are available on mobile devices. Do not use such Services
in a way that distracts you and prevents you from obeying traffic or safety
laws.You must follow any policies made available to you within the Services.

Don’t misuse our Services. For example, don’t interfere with our Services or
try to access them using a method other than the interface and the instructions
that we provide. You may use our Services only as permitted by law, including
applicable export and re-export control laws and regulations. We may suspend or
stop providing our Services to you if you do not comply with our terms or policies
or if we are investigating suspected misconduct.

Using our Services does not give you ownership of any intellectual property
rights in our Services or the content you access. You may not use content from our
Services unless you obtain permission from its owner or are otherwise permitted by
law. These terms do not grant you the right to use any branding or logos used in
our Services. Don’t remove, obscure, or alter any legal notices displayed in or
along with our Services.
Our Services display some content that is not Google’s. This content is the
sole responsibility of the entity that makes it available. We may review content to
determine whether it is illegal or violates our policies, and we may remove or
refuse to display content that we reasonably believe violates our policies or the
law. But that does not necessarily mean that we review content, so please don’t
assume that we do.

In connection with your use of the Services, we may send you service
announcements, administrative messages, and other information. You may opt out of
some of those communications.

Some of our Services are available on mobile devices. Do not use such Services
in a way that distracts you and prevents you from obeying traffic or safety
laws.You must follow any policies made available to you within the Services.

Don’t misuse our Services. For example, don’t interfere with our Services or
try to access them using a method other than the interface and the instructions
that we provide. You may use our Services only as permitted by law, including
applicable export and re-export control laws and regulations. We may suspend or
stop providing our Services to you if you do not comply with our terms or policies
or if we are investigating suspected misconduct.

Using our Services does not give you ownership of any intellectual property
rights in our Services or the content you access. You may not use content from our
Services unless you obtain permission from its owner or are otherwise permitted by
law. These terms do not grant you the right to use any branding or logos used in
our Services. Don’t remove, obscure, or alter any legal notices displayed in or
along with our Services.

Our Services display some content that is not Google’s. This content is the
sole responsibility of the entity that makes it available. We may review content to
determine whether it is illegal or violates our policies, and we may remove or
refuse to display content that we reasonably believe violates our policies or the
law. But that does not necessarily mean that we review content, so please don’t
assume that we do.

In connection with your use of the Services, we may send you service
announcements, administrative messages, and other information. You may opt out of
some of those communications.

Some of our Services are available on mobile devices. Do not use such Services
in a way that distracts you and prevents you from obeying traffic or safety
laws.You must follow any policies made available to you within the Services.

Don’t misuse our Services. For example, don’t interfere with our Services or
try to access them using a method other than the interface and the instructions
that we provide. You may use our Services only as permitted by law, including
applicable export and re-export control laws and regulations. We may suspend or
stop providing our Services to you if you do not comply with our terms or policies
or if we are investigating suspected misconduct.

Using our Services does not give you ownership of any intellectual property
rights in our Services or the content you access. You may not use content from our
Services unless you obtain permission from its owner or are otherwise permitted by
law. These terms do not grant you the right to use any branding or logos used in
our Services. Don’t remove, obscure, or alter any legal notices displayed in or
along with our Services.
Our Services display some content that is not Google’s. This content is the
sole responsibility of the entity that makes it available. We may review content to
determine whether it is illegal or violates our policies, and we may remove or
refuse to display content that we reasonably believe violates our policies or the
law. But that does not necessarily mean that we review content, so please don’t
assume that we do.

In connection with your use of the Services, we may send you service
announcements, administrative messages, and other information. You may opt out of
some of those communications.

Some of our Services are available on mobile devices. Do not use such Services
in a way that distracts you and prevents you from obeying traffic or safety
laws.You must follow any policies made available to you within the Services.

Don’t misuse our Services. For example, don’t interfere with our Services or
try to access them using a method other than the interface and the instructions
that we provide. You may use our Services only as permitted by law, including
applicable export and re-export control laws and regulations. We may suspend or
stop providing our Services to you if you do not comply with our terms or policies
or if we are investigating suspected misconduct.

Using our Services does not give you ownership of any intellectual property
rights in our Services or the content you access. You may not use content from our
Services unless you obtain permission from its owner or are otherwise permitted by
law. These terms do not grant you the right to use any branding or logos used in
our Services. Don’t remove, obscure, or alter any legal notices displayed in or
along with our Services.

Our Services display some content that is not Google’s. This content is the
sole responsibility of the entity that makes it available. We may review content to
determine whether it is illegal or violates our policies, and we may remove or
refuse to display content that we reasonably believe violates our policies or the
law. But that does not necessarily mean that we review content, so please don’t
assume that we do.

In connection with your use of the Services, we may send you service
announcements, administrative messages, and other information. You may opt out of
some of those communications.

Some of our Services are available on mobile devices. Do not use such Services
in a way that distracts you and prevents you from obeying traffic or safety
laws.You must follow any policies made available to you within the Services.

Don’t misuse our Services. For example, don’t interfere with our Services or
try to access them using a method other than the interface and the instructions
that we provide. You may use our Services only as permitted by law, including
applicable export and re-export control laws and regulations. We may suspend or
stop providing our Services to you if you do not comply with our terms or policies
or if we are investigating suspected misconduct.

Using our Services does not give you ownership of any intellectual property
rights in our Services or the content you access. You may not use content from our
Services unless you obtain permission from its owner or are otherwise permitted by
law. These terms do not grant you the right to use any branding or logos used in
our Services. Don’t remove, obscure, or alter any legal notices displayed in or
along with our Services.

Our Services display some content that is not Google’s. This content is the
sole responsibility of the entity that makes it available. We may review content to
determine whether it is illegal or violates our policies, and we may remove or
refuse to display content that we reasonably believe violates our policies or the
law. But that does not necessarily mean that we review content, so please don’t
assume that we do.

In connection with your use of the Services, we may send you service
announcements, administrative messages, and other information. You may opt out of
some of those communications.

Some of our Services are available on mobile devices. Do not use such Services
in a way that distracts you and prevents you from obeying traffic or safety
laws.You must follow any policies made available to you within the Services.

Don’t misuse our Services. For example, don’t interfere with our Services or
try to access them using a method other than the interface and the instructions
that we provide. You may use our Services only as permitted by law, including
applicable export and re-export control laws and regulations. We may suspend or
stop providing our Services to you if you do not comply with our terms or policies
or if we are investigating suspected misconduct.

Using our Services does not give you ownership of any intellectual property
rights in our Services or the content you access. You may not use content from our
Services unless you obtain permission from its owner or are otherwise permitted by
law. These terms do not grant you the right to use any branding or logos used in
our Services. Don’t remove, obscure, or alter any legal notices displayed in or
along with our Services.

Our Services display some content that is not Google’s. This content is the
sole responsibility of the entity that makes it available. We may review content to
determine whether it is illegal or violates our policies, and we may remove or
refuse to display content that we reasonably believe violates our policies or the
law. But that does not necessarily mean that we review content, so please don’t
assume that we do.

In connection with your use of the Services, we may send you service
announcements, administrative messages, and other information. You may opt out of
some of those communications.

Some of our Services are available on mobile devices. Do not use such Services
in a way that distracts you and prevents you from obeying traffic or safety
laws.You must follow any policies made available to you within the Services.

Don’t misuse our Services. For example, don’t interfere with our Services or
try to access them using a method other than the interface and the instructions
that we provide. You may use our Services only as permitted by law, including
applicable export and re-export control laws and regulations. We may suspend or
stop providing our Services to you if you do not comply with our terms or policies
or if we are investigating suspected misconduct.

Using our Services does not give you ownership of any intellectual property
rights in our Services or the content you access. You may not use content from our
Services unless you obtain permission from its owner or are otherwise permitted by
law. These terms do not grant you the right to use any branding or logos used in
our Services. Don’t remove, obscure, or alter any legal notices displayed in or
along with our Services.

Our Services display some content that is not Google’s. This content is the
sole responsibility of the entity that makes it available. We may review content to
determine whether it is illegal or violates our policies, and we may remove or
refuse to display content that we reasonably believe violates our policies or the
law. But that does not necessarily mean that we review content, so please don’t
assume that we do.

In connection with your use of the Services, we may send you service
announcements, administrative messages, and other information. You may opt out of
some of those communications.

Some of our Services are available on mobile devices. Do not use such Services
in a way that distracts you and prevents you from obeying traffic or safety
laws.You must follow any policies made available to you within the Services.

Don’t misuse our Services. For example, don’t interfere with our Services or
try to access them using a method other than the interface and the instructions
that we provide. You may use our Services only as permitted by law, including
applicable export and re-export control laws and regulations. We may suspend or
stop providing our Services to you if you do not comply with our terms or policies
or if we are investigating suspected misconduct.

Using our Services does not give you ownership of any intellectual property
rights in our Services or the content you access. You may not use content from our
Services unless you obtain permission from its owner or are otherwise permitted by
law. These terms do not grant you the right to use any branding or logos used in
our Services. Don’t remove, obscure, or alter any legal notices displayed in or
along with our Services.

Our Services display some content that is not Google’s. This content is the
sole responsibility of the entity that makes it available. We may review content to
determine whether it is illegal or violates our policies, and we may remove or
refuse to display content that we reasonably believe violates our policies or the
law. But that does not necessarily mean that we review content, so please don’t
assume that we do.

In connection with your use of the Services, we may send you service
announcements, administrative messages, and other information. You may opt out of
some of those communications.

Some of our Services are available on mobile devices. Do not use such Services
in a way that distracts you and prevents you from obeying traffic or safety
laws.You must follow any policies made available to you within the Services.

Don’t misuse our Services. For example, don’t interfere with our Services or
try to access them using a method other than the interface and the instructions
that we provide. You may use our Services only as permitted by law, including
applicable export and re-export control laws and regulations. We may suspend or
stop providing our Services to you if you do not comply with our terms or policies
or if we are investigating suspected misconduct.

Using our Services does not give you ownership of any intellectual property
rights in our Services or the content you access. You may not use content from our
Services unless you obtain permission from its owner or are otherwise permitted by
law. These terms do not grant you the right to use any branding or logos used in
our Services. Don’t remove, obscure, or alter any legal notices displayed in or
along with our Services.

Our Services display some content that is not Google’s. This content is the
sole responsibility of the entity that makes it available. We may review content to
determine whether it is illegal or violates our policies, and we may remove or
refuse to display content that we reasonably believe violates our policies or the
law. But that does not necessarily mean that we review content, so please don’t
assume that we do.

In connection with your use of the Services, we may send you service
announcements, administrative messages, and other information. You may opt out of
some of those communications.

Some of our Services are available on mobile devices. Do not use such Services
in a way that distracts you and prevents you from obeying traffic or safety
laws.You must follow any policies made available to you within the Services.

Don’t misuse our Services. For example, don’t interfere with our Services or
try to access them using a method other than the interface and the instructions
that we provide. You may use our Services only as permitted by law, including
applicable export and re-export control laws and regulations. We may suspend or
stop providing our Services to you if you do not comply with our terms or policies
or if we are investigating suspected misconduct.

Using our Services does not give you ownership of any intellectual property
rights in our Services or the content you access. You may not use content from our
Services unless you obtain permission from its owner or are otherwise permitted by
law. These terms do not grant you the right to use any branding or logos used in
our Services. Don’t remove, obscure, or alter any legal notices displayed in or
along with our Services.

Our Services display some content that is not Google’s. This content is the
sole responsibility of the entity that makes it available. We may review content to
determine whether it is illegal or violates our policies, and we may remove or
refuse to display content that we reasonably believe violates our policies or the
law. But that does not necessarily mean that we review content, so please don’t
assume that we do.

In connection with your use of the Services, we may send you service
announcements, administrative messages, and other information. You may opt out of
some of those communications.

Some of our Services are available on mobile devices. Do not use such Services
in a way that distracts you and prevents you from obeying traffic or safety
laws.</p>
</div>
<script>
document.getElementById("div1").scrollTop=240;
</script>
</body>

</html><html>
<head><title>scrollTo javascript program</title></head>
<body>
<p>Don’t misuse our Services. For example, don’t interfere with our Services or
try to access them using a method other than the interface and the instructions
that we provide. You may use our Services only as permitted by law, including
applicable export and re-export control laws and regulations. We may suspend or
stop providing our Services to you if you do not comply with our terms or policies
or if we are investigating suspected misconduct.</p><p>Don’t misuse our Services.
For example, don’t interfere with our Services or try to access them using a method
other than the interface and the instructions that we provide. You may use our
Services only as permitted by law, including applicable export and re-export
control laws and regulations. We may suspend or stop providing our Services to you
if you do not comply with our terms or policies or if we are investigating
suspected misconduct.</p><p>Don’t misuse our Services. For example, don’t interfere
with our Services or try to access them using a method other than the interface and
the instructions that we provide. You may use our Services only as permitted by
law, including applicable export and re-export control laws and regulations. We may
suspend or stop providing our Services to you if you do not comply with our terms
or policies or if we are investigating suspected misconduct.</p><p>Don’t misuse our
Services. For example, don’t interfere with our Services or try to access them
using a method other than the interface and the instructions that we provide. You
may use our Services only as permitted by law, including applicable export and re-
export control laws and regulations. We may suspend or stop providing our Services
to you if you do not comply with our terms or policies or if we are investigating
suspected misconduct.</p><p>Don’t misuse our Services. For example, don’t interfere
with our Services or try to access them using a method other than the interface and
the instructions that we provide. You may use our Services only as permitted by
law, including applicable export and re-export control laws and regulations. We may
suspend or stop providing our Services to you if you do not comply with our terms
or policies or if we are investigating suspected misconduct.</p><p>Don’t misuse our
Services. For example, don’t interfere with our Services or try to access them
using a method other than the interface and the instructions that we provide. You
may use our Services only as permitted by law, including applicable export and re-
export control laws and regulations. We may suspend or stop providing our Services
to you if you do not comply with our terms or policies or if we are investigating
suspected misconduct.</p><p>Don’t misuse our Services. For example, don’t interfere
with our Services or try to access them using a method other than the interface and
the instructions that we provide. You may use our Services only as permitted by
law, including applicable export and re-export control laws and regulations. We may
suspend or stop providing our Services to you if you do not comply with our terms
or policies or if we are investigating suspected misconduct.</p><p>Don’t misuse our
Services. For example, don’t interfere with our Services or try to access them
using a method other than the interface and the instructions that we provide. You
may use our Services only as permitted by law, including applicable export and re-
export control laws and regulations. We may suspend or stop providing our Services
to you if you do not comply with our terms or policies or if we are investigating
suspected misconduct.</p><p>Don’t misuse our Services. For example, don’t interfere
with our Services or try to access them using a method other than the interface and
the instructions that we provide. You may use our Services only as permitted by
law, including applicable export and re-export control laws and regulations. We may
suspend or stop providing our Services to you if you do not comply with our terms
or policies or if we are investigating suspected misconduct.</p><p>Don’t misuse our
Services. For example, don’t interfere with our Services or try to access them
using a method other than the interface and the instructions that we provide. You
may use our Services only as permitted by law, including applicable export and re-
export control laws and regulations. We may suspend or stop providing our Services
to you if you do not comply with our terms or policies or if we are investigating
suspected misconduct.</p><p>Don’t misuse our Services. For example, don’t interfere
with our Services or try to access them using a method other than the interface and
the instructions that we provide. You may use our Services only as permitted by
law, including applicable export and re-export control laws and regulations. We may
suspend or stop providing our Services to you if you do not comply with our terms
or policies or if we are investigating suspected misconduct.</p><p>Don’t misuse our
Services. For example, don’t interfere with our Services or try to access them
using a method other than the interface and the instructions that we provide. You
may use our Services only as permitted by law, including applicable export and re-
export control laws and regulations. We may suspend or stop providing our Services
to you if you do not comply with our terms or policies or if we are investigating
suspected misconduct.</p><p>Don’t misuse our Services. For example, don’t interfere
with our Services or try to access them using a method other than the interface and
the instructions that we provide. You may use our Services only as permitted by
law, including applicable export and re-export control laws and regulations. We may
suspend or stop providing our Services to you if you do not comply with our terms
or policies or if we are investigating suspected misconduct.</p><p>Don’t misuse our
Services. For example, don’t interfere with our Services or try to access them
using a method other than the interface and the instructions that we provide. You
may use our Services only as permitted by law, including applicable export and re-
export control laws and regulations. We may suspend or stop providing our Services
to you if you do not comply with our terms or policies or if we are investigating
suspected misconduct.</p><p>Don’t misuse our Services. For example, don’t interfere
with our Services or try to access them using a method other than the interface and
the instructions that we provide. You may use our Services only as permitted by
law, including applicable export and re-export control laws and regulations. We may
suspend or stop providing our Services to you if you do not comply with our terms
or policies or if we are investigating suspected misconduct.</p><p>Don’t misuse our
Services. For example, don’t interfere with our Services or try to access them
using a method other than the interface and the instructions that we provide. You
may use our Services only as permitted by law, including applicable export and re-
export control laws and regulations. We may suspend or stop providing our Services
to you if you do not comply with our terms or policies or if we are investigating
suspected misconduct.</p><p>Don’t misuse our Services. For example, don’t interfere
with our Services or try to access them using a method other than the interface and
the instructions that we provide. You may use our Services only as permitted by
law, including applicable export and re-export control laws and regulations. We may
suspend or stop providing our Services to you if you do not comply with our terms
or policies or if we are investigating suspected misconduct.</p><p>Don’t misuse our
Services. For example, don’t interfere with our Services or try to access them
using a method other than the interface and the instructions that we provide. You
may use our Services only as permitted by law, including applicable export and re-
export control laws and regulations. We may suspend or stop providing our Services
to you if you do not comply with our terms or policies or if we are investigating
suspected misconduct.</p><p>Don’t misuse our Services. For example, don’t interfere
with our Services or try to access them using a method other than the interface and
the instructions that we provide. You may use our Services only as permitted by
law, including applicable export and re-export control laws and regulations. We may
suspend or stop providing our Services to you if you do not comply with our terms
or policies or if we are investigating suspected misconduct.</p><p>Don’t misuse our
Services. For example, don’t interfere with our Services or try to access them
using a method other than the interface and the instructions that we provide. You
may use our Services only as permitted by law, including applicable export and re-
export control laws and regulations. We may suspend or stop providing our Services
to you if you do not comply with our terms or policies or if we are investigating
suspected misconduct.</p><p>Don’t misuse our Services. For example, don’t interfere
with our Services or try to access them using a method other than the interface and
the instructions that we provide. You may use our Services only as permitted by
law, including applicable export and re-export control laws and regulations. We may
suspend or stop providing our Services to you if you do not comply with our terms
or policies or if we are investigating suspected misconduct.</p><p>Don’t misuse our
Services. For example, don’t interfere with our Services or try to access them
using a method other than the interface and the instructions that we provide. You
may use our Services only as permitted by law, including applicable export and re-
export control laws and regulations. We may suspend or stop providing our Services
to you if you do not comply with our terms
or policies or if we are investigating suspected misconduct.</p><p>Don’t misuse
our Services. For example, don’t interfere with our Services or try to access them
using a method other than the interface and the instructions that we provide. You
may use our Services only as permitted by law, including applicable export and re-
export control laws and regulations. We may suspend or stop providing our Services
to you if you do not comply with our terms or policies or if we are investigating
suspected misconduct.</p><p>Don’t misuse our Services. For example, don’t interfere
with our Services or try to access them using a method other than the interface and
the instructions that we provide. You may use our Services only as permitted by
law, including applicable export and re-export control laws and regulations. We may
suspend or stop providing our Services to you if you do not comply with our terms
or policies or if we are investigating suspected misconduct.</p><p>Don’t misuse our
Services. For example, don’t interfere with our Services or try to access them
using a method other than the interface and the instructions that we provide. You
may use our Services only as permitted by law, including applicable export and re-
export control laws and regulations. We may suspend or stop providing our Services
to you if you do not comply with our terms or policies or if we are investigating
suspected misconduct.</p>

</h3>
</body>
<script type="text/javascript">
window.scrollTo(0,1000);
</script>
</html>

<html>
<head><title>click real time task 2 javascript program</title>
<style>
img{
margin:2px;
cursor:pointer;
}
.class1{
border: 2px solid red;
}
</style>
</head>
<body><h3>
click realtime task 2
</h3>
<img src="tick.png" width="100px" height="150px"/>
<img src="trees.jpg" width="100px" height="150px"/><br/>
<input type="button" value="Buy Now" id="button1"/>
<table border="1" id="table1">
<tr><th>SI.No</th>
<th>Title</th>
<th>Price</th>
</tr>
Total Price:<span id="span1"></span>
</table>

<script type="text/javascript">
var allBooks=[
{bookImage:"tick.png",title:"tick book",price:10},
{bookImage:"trees.jpg",title:"trees book",price:12},
];
var selectedBooks=[];
var selectedBooks1=[];
var imageTags=document.getElementsByTagName("img");
for(var i=0;i<imageTags.length;i++)
{
imageTags[i].addEventListener("click",sample);
}
function sample(event){
if(event.target.getAttribute("class")=="class1")
{
event.target.setAttribute("class","");
}
else
{
event.target.setAttribute("class","class1");
}

}
document.getElementById("button1").addEventListener("click",sample2);
function sample2(){
var totalPrice=0;
var selectedBooks=document.getElementsByClassName("class1");
//console.log(selectedBooks);
for(i=0;i<selectedBooks.length;i++)
{
var currentImgSrc=selectedBooks[i].getAttribute("src");
var n=0;
for(j=0;j<allBooks.length;j++)
{
if(currentImgSrc==allBooks[j].bookImage)
{
n++;
totalPrice=totalPrice+allBooks[j].price;

selectedBooks1.push({slno:n,title:allBooks[j].title,price:allBooks[j].price});
}
}

}
console.log(selectedBooks1);
for(var i=0;i<selectedBooks1.length;i++)
{
var s="<tr><td>" +selectedBooks1[i].slno +"</td><td>"
+selectedBooks1[i].title+"</td><td>"+selectedBooks1[i].price + "</td></tr>";
document.getElementById("table1").innerHTML += s;
}
document.getElementById("span1").innerHTML=totalPrice;
}
</script>
</body>

</html>
<html>
<head>
<title>Jquery</title>
</head>
<body>
<h4>contains filter</h4>
<p>Don’t misuse our Services. For example, don’t interfere with our
Services or try to access them using a method other than the interface and the
instructions that we provide. You may use our Services only as permitted by law,
including applicable export and re-export control laws and regulations. We may
suspend or stop providing our Services to you if you do not comply with our terms
or policies or if we are investigating suspected misconduct.</p>
<p>Don’t misuse our Services. For example, don’t interfere with our
Services or try to access them using a method other than the interface and the
instructions that we provide. You may use our Services only as permitted by law,
including applicable export and re-export control laws and regulations. We may
suspend or stop providing our Services to you if you do not comply with our terms
or policies or if we are investigating suspected misconduct.</p>
<p>Don’t misuse our Services. For example, don’t interfere with our
Services or try to access them using a method other than the interface and the
instructions that we provide. You may use our Services only as permitted by law,
including applicable export and re-export control laws and regulations. We may
suspend or stop providing our Services to you if you do not comply with our terms
or policies or if we are investigating suspected misconduct.</p>
<script src="jquery-3.3.1.js"></script>
<script>
$("p:contains('Services')").css("background-color","lightblue");
</script>
</body>
</html>

You might also like