How to search with JavaScript
I need to make a search bar to find h1
in divs but I need also to hide the hall div not only h1
that not matches I found this on w3school but I don't know how $(this)
works I need to select the div with class blog-card
<input id="myInput" type="text" placeholder="Search.." />
<div class="blog-card col-sm-12 col-md-6">
<div class="meta">
<div class="photo" style="background-image: url(https://storage.googleapis.com/chydlx/codepen/blog-cards/image-1.jpg)"></div>
<ul class="details">
<li class="author"><a href="#">John Doe</a></li>
<li class="date">Aug. 24, 2015</li>
<li class="tags">
<ul>
<li><a href="#">Learn</a></li>
<li><a href="#">Code</a></li>
<li><a href="#">HTML</a></li>
<li><a href="#">CSS</a></li>
</ul>
</li>
</ul>
</div>
<div class="description">
<h1>Learning to Code</h1>
<h2>Opening a door to the future</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad eum dolorum architecto obcaecati enim dicta praesentium, quam nobis! Neque ad aliquam facilis numquam. Veritatis, sit.</p>
<p class="read-more">
<a href="#">Read More</a>
</p>
</div>
</div>
$(document).ready(function () {
$("#myInput").on("keyup", function () {
var value = $(this).val().toLowerCase();
$(".blog-card .description h1").filter(function () {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
});
});
});
javascript jquery html css this
add a comment |
I need to make a search bar to find h1
in divs but I need also to hide the hall div not only h1
that not matches I found this on w3school but I don't know how $(this)
works I need to select the div with class blog-card
<input id="myInput" type="text" placeholder="Search.." />
<div class="blog-card col-sm-12 col-md-6">
<div class="meta">
<div class="photo" style="background-image: url(https://storage.googleapis.com/chydlx/codepen/blog-cards/image-1.jpg)"></div>
<ul class="details">
<li class="author"><a href="#">John Doe</a></li>
<li class="date">Aug. 24, 2015</li>
<li class="tags">
<ul>
<li><a href="#">Learn</a></li>
<li><a href="#">Code</a></li>
<li><a href="#">HTML</a></li>
<li><a href="#">CSS</a></li>
</ul>
</li>
</ul>
</div>
<div class="description">
<h1>Learning to Code</h1>
<h2>Opening a door to the future</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad eum dolorum architecto obcaecati enim dicta praesentium, quam nobis! Neque ad aliquam facilis numquam. Veritatis, sit.</p>
<p class="read-more">
<a href="#">Read More</a>
</p>
</div>
</div>
$(document).ready(function () {
$("#myInput").on("keyup", function () {
var value = $(this).val().toLowerCase();
$(".blog-card .description h1").filter(function () {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
});
});
});
javascript jquery html css this
1
Can you add a minimal code that you've tried so far? So that we can understand the problem thoroughly...
– CodeBlaze
Nov 22 '18 at 9:21
show us your html code
– לבני מלכה
Nov 22 '18 at 9:23
i added html code
– m.nabil
Nov 22 '18 at 9:25
Where and what is the element with the idmyInput
? It's not in your code
– HerrSerker
Nov 22 '18 at 9:36
before the div tag
– m.nabil
Nov 22 '18 at 9:43
add a comment |
I need to make a search bar to find h1
in divs but I need also to hide the hall div not only h1
that not matches I found this on w3school but I don't know how $(this)
works I need to select the div with class blog-card
<input id="myInput" type="text" placeholder="Search.." />
<div class="blog-card col-sm-12 col-md-6">
<div class="meta">
<div class="photo" style="background-image: url(https://storage.googleapis.com/chydlx/codepen/blog-cards/image-1.jpg)"></div>
<ul class="details">
<li class="author"><a href="#">John Doe</a></li>
<li class="date">Aug. 24, 2015</li>
<li class="tags">
<ul>
<li><a href="#">Learn</a></li>
<li><a href="#">Code</a></li>
<li><a href="#">HTML</a></li>
<li><a href="#">CSS</a></li>
</ul>
</li>
</ul>
</div>
<div class="description">
<h1>Learning to Code</h1>
<h2>Opening a door to the future</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad eum dolorum architecto obcaecati enim dicta praesentium, quam nobis! Neque ad aliquam facilis numquam. Veritatis, sit.</p>
<p class="read-more">
<a href="#">Read More</a>
</p>
</div>
</div>
$(document).ready(function () {
$("#myInput").on("keyup", function () {
var value = $(this).val().toLowerCase();
$(".blog-card .description h1").filter(function () {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
});
});
});
javascript jquery html css this
I need to make a search bar to find h1
in divs but I need also to hide the hall div not only h1
that not matches I found this on w3school but I don't know how $(this)
works I need to select the div with class blog-card
<input id="myInput" type="text" placeholder="Search.." />
<div class="blog-card col-sm-12 col-md-6">
<div class="meta">
<div class="photo" style="background-image: url(https://storage.googleapis.com/chydlx/codepen/blog-cards/image-1.jpg)"></div>
<ul class="details">
<li class="author"><a href="#">John Doe</a></li>
<li class="date">Aug. 24, 2015</li>
<li class="tags">
<ul>
<li><a href="#">Learn</a></li>
<li><a href="#">Code</a></li>
<li><a href="#">HTML</a></li>
<li><a href="#">CSS</a></li>
</ul>
</li>
</ul>
</div>
<div class="description">
<h1>Learning to Code</h1>
<h2>Opening a door to the future</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad eum dolorum architecto obcaecati enim dicta praesentium, quam nobis! Neque ad aliquam facilis numquam. Veritatis, sit.</p>
<p class="read-more">
<a href="#">Read More</a>
</p>
</div>
</div>
$(document).ready(function () {
$("#myInput").on("keyup", function () {
var value = $(this).val().toLowerCase();
$(".blog-card .description h1").filter(function () {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
});
});
});
javascript jquery html css this
javascript jquery html css this
edited Nov 22 '18 at 9:43
m.nabil
asked Nov 22 '18 at 9:19
m.nabilm.nabil
86
86
1
Can you add a minimal code that you've tried so far? So that we can understand the problem thoroughly...
– CodeBlaze
Nov 22 '18 at 9:21
show us your html code
– לבני מלכה
Nov 22 '18 at 9:23
i added html code
– m.nabil
Nov 22 '18 at 9:25
Where and what is the element with the idmyInput
? It's not in your code
– HerrSerker
Nov 22 '18 at 9:36
before the div tag
– m.nabil
Nov 22 '18 at 9:43
add a comment |
1
Can you add a minimal code that you've tried so far? So that we can understand the problem thoroughly...
– CodeBlaze
Nov 22 '18 at 9:21
show us your html code
– לבני מלכה
Nov 22 '18 at 9:23
i added html code
– m.nabil
Nov 22 '18 at 9:25
Where and what is the element with the idmyInput
? It's not in your code
– HerrSerker
Nov 22 '18 at 9:36
before the div tag
– m.nabil
Nov 22 '18 at 9:43
1
1
Can you add a minimal code that you've tried so far? So that we can understand the problem thoroughly...
– CodeBlaze
Nov 22 '18 at 9:21
Can you add a minimal code that you've tried so far? So that we can understand the problem thoroughly...
– CodeBlaze
Nov 22 '18 at 9:21
show us your html code
– לבני מלכה
Nov 22 '18 at 9:23
show us your html code
– לבני מלכה
Nov 22 '18 at 9:23
i added html code
– m.nabil
Nov 22 '18 at 9:25
i added html code
– m.nabil
Nov 22 '18 at 9:25
Where and what is the element with the id
myInput
? It's not in your code– HerrSerker
Nov 22 '18 at 9:36
Where and what is the element with the id
myInput
? It's not in your code– HerrSerker
Nov 22 '18 at 9:36
before the div tag
– m.nabil
Nov 22 '18 at 9:43
before the div tag
– m.nabil
Nov 22 '18 at 9:43
add a comment |
2 Answers
2
active
oldest
votes
$(document).ready(function () {
$('#searchbuttonid').on('click',function(){
$(".blog-card h1").each(function(){
console.log($(this).attr('Id'));
});
});
});
This code will return all the h1
tag's Id in console in div with class blogcard
this line hits the event handler on clicking of search button
$('#searchbuttonid').on('click',function(){
then the h1
element inside blog-card
is searched by jquery
so it is written as
$(".blog-card h1").each(function(){
the reason we apply .each
to select all h1
in the main class
after entering into the function, it then gets all the Id's of the h1
element in the loop using $(this).attr('Id')
then its printed on console using
console.log($(this).attr('Id'));
i don't understand
– m.nabil
Nov 22 '18 at 9:31
check the edited answer again
– Yash Soni
Nov 22 '18 at 9:35
i don't have id for each one i just need to select this and go above to it's class
– m.nabil
Nov 22 '18 at 10:06
specify exact usage of h1 tag, then i can help you
– Yash Soni
Nov 22 '18 at 10:46
add a comment |
HTML code
<input id="search" type="text" placeholder="Search.." />
<div class="blog-card col-sm-12 col-md-6">
<div class="meta">
<div class="photo" style="background-image: url(https://storage.googleapis.com/chydlx/codepen/blog-cards/image-1.jpg)"></div>
<ul class="details">
<li class="author"><a href="#">John Doe</a></li>
<li class="date">Aug. 24, 2015</li>
<li class="tags">
<ul>
<li><a href="#">Learn</a></li>
<li><a href="#">Code</a></li>
<li><a href="#">HTML</a></li>
<li><a href="#">CSS</a></li>
</ul>
</li>
</ul>
</div>
<div class="description">
<h1>Learning to Code</h1>
<h2>Opening a door to the future</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad eum dolorum architecto obcaecati enim dicta praesentium, quam nobis! Neque ad aliquam facilis numquam. Veritatis, sit.</p>
<p class="read-more">
<a href="#">Read More</a>
</p>
</div>
</div>
Javascript Code
$(document).ready(function () {
$("#search").on("keyup", function () {
var value = $(this).val().toLowerCase();
$(".blog-card .description h1").filter(function () {
$(this).parent(".description").parent(".blog-card").toggle($(this).text().toLowerCase().indexOf(value) > -1)
});
});
});
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53427484%2fhow-to-search-with-javascript%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$(document).ready(function () {
$('#searchbuttonid').on('click',function(){
$(".blog-card h1").each(function(){
console.log($(this).attr('Id'));
});
});
});
This code will return all the h1
tag's Id in console in div with class blogcard
this line hits the event handler on clicking of search button
$('#searchbuttonid').on('click',function(){
then the h1
element inside blog-card
is searched by jquery
so it is written as
$(".blog-card h1").each(function(){
the reason we apply .each
to select all h1
in the main class
after entering into the function, it then gets all the Id's of the h1
element in the loop using $(this).attr('Id')
then its printed on console using
console.log($(this).attr('Id'));
i don't understand
– m.nabil
Nov 22 '18 at 9:31
check the edited answer again
– Yash Soni
Nov 22 '18 at 9:35
i don't have id for each one i just need to select this and go above to it's class
– m.nabil
Nov 22 '18 at 10:06
specify exact usage of h1 tag, then i can help you
– Yash Soni
Nov 22 '18 at 10:46
add a comment |
$(document).ready(function () {
$('#searchbuttonid').on('click',function(){
$(".blog-card h1").each(function(){
console.log($(this).attr('Id'));
});
});
});
This code will return all the h1
tag's Id in console in div with class blogcard
this line hits the event handler on clicking of search button
$('#searchbuttonid').on('click',function(){
then the h1
element inside blog-card
is searched by jquery
so it is written as
$(".blog-card h1").each(function(){
the reason we apply .each
to select all h1
in the main class
after entering into the function, it then gets all the Id's of the h1
element in the loop using $(this).attr('Id')
then its printed on console using
console.log($(this).attr('Id'));
i don't understand
– m.nabil
Nov 22 '18 at 9:31
check the edited answer again
– Yash Soni
Nov 22 '18 at 9:35
i don't have id for each one i just need to select this and go above to it's class
– m.nabil
Nov 22 '18 at 10:06
specify exact usage of h1 tag, then i can help you
– Yash Soni
Nov 22 '18 at 10:46
add a comment |
$(document).ready(function () {
$('#searchbuttonid').on('click',function(){
$(".blog-card h1").each(function(){
console.log($(this).attr('Id'));
});
});
});
This code will return all the h1
tag's Id in console in div with class blogcard
this line hits the event handler on clicking of search button
$('#searchbuttonid').on('click',function(){
then the h1
element inside blog-card
is searched by jquery
so it is written as
$(".blog-card h1").each(function(){
the reason we apply .each
to select all h1
in the main class
after entering into the function, it then gets all the Id's of the h1
element in the loop using $(this).attr('Id')
then its printed on console using
console.log($(this).attr('Id'));
$(document).ready(function () {
$('#searchbuttonid').on('click',function(){
$(".blog-card h1").each(function(){
console.log($(this).attr('Id'));
});
});
});
This code will return all the h1
tag's Id in console in div with class blogcard
this line hits the event handler on clicking of search button
$('#searchbuttonid').on('click',function(){
then the h1
element inside blog-card
is searched by jquery
so it is written as
$(".blog-card h1").each(function(){
the reason we apply .each
to select all h1
in the main class
after entering into the function, it then gets all the Id's of the h1
element in the loop using $(this).attr('Id')
then its printed on console using
console.log($(this).attr('Id'));
edited Nov 22 '18 at 9:35
answered Nov 22 '18 at 9:24
Yash SoniYash Soni
47510
47510
i don't understand
– m.nabil
Nov 22 '18 at 9:31
check the edited answer again
– Yash Soni
Nov 22 '18 at 9:35
i don't have id for each one i just need to select this and go above to it's class
– m.nabil
Nov 22 '18 at 10:06
specify exact usage of h1 tag, then i can help you
– Yash Soni
Nov 22 '18 at 10:46
add a comment |
i don't understand
– m.nabil
Nov 22 '18 at 9:31
check the edited answer again
– Yash Soni
Nov 22 '18 at 9:35
i don't have id for each one i just need to select this and go above to it's class
– m.nabil
Nov 22 '18 at 10:06
specify exact usage of h1 tag, then i can help you
– Yash Soni
Nov 22 '18 at 10:46
i don't understand
– m.nabil
Nov 22 '18 at 9:31
i don't understand
– m.nabil
Nov 22 '18 at 9:31
check the edited answer again
– Yash Soni
Nov 22 '18 at 9:35
check the edited answer again
– Yash Soni
Nov 22 '18 at 9:35
i don't have id for each one i just need to select this and go above to it's class
– m.nabil
Nov 22 '18 at 10:06
i don't have id for each one i just need to select this and go above to it's class
– m.nabil
Nov 22 '18 at 10:06
specify exact usage of h1 tag, then i can help you
– Yash Soni
Nov 22 '18 at 10:46
specify exact usage of h1 tag, then i can help you
– Yash Soni
Nov 22 '18 at 10:46
add a comment |
HTML code
<input id="search" type="text" placeholder="Search.." />
<div class="blog-card col-sm-12 col-md-6">
<div class="meta">
<div class="photo" style="background-image: url(https://storage.googleapis.com/chydlx/codepen/blog-cards/image-1.jpg)"></div>
<ul class="details">
<li class="author"><a href="#">John Doe</a></li>
<li class="date">Aug. 24, 2015</li>
<li class="tags">
<ul>
<li><a href="#">Learn</a></li>
<li><a href="#">Code</a></li>
<li><a href="#">HTML</a></li>
<li><a href="#">CSS</a></li>
</ul>
</li>
</ul>
</div>
<div class="description">
<h1>Learning to Code</h1>
<h2>Opening a door to the future</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad eum dolorum architecto obcaecati enim dicta praesentium, quam nobis! Neque ad aliquam facilis numquam. Veritatis, sit.</p>
<p class="read-more">
<a href="#">Read More</a>
</p>
</div>
</div>
Javascript Code
$(document).ready(function () {
$("#search").on("keyup", function () {
var value = $(this).val().toLowerCase();
$(".blog-card .description h1").filter(function () {
$(this).parent(".description").parent(".blog-card").toggle($(this).text().toLowerCase().indexOf(value) > -1)
});
});
});
add a comment |
HTML code
<input id="search" type="text" placeholder="Search.." />
<div class="blog-card col-sm-12 col-md-6">
<div class="meta">
<div class="photo" style="background-image: url(https://storage.googleapis.com/chydlx/codepen/blog-cards/image-1.jpg)"></div>
<ul class="details">
<li class="author"><a href="#">John Doe</a></li>
<li class="date">Aug. 24, 2015</li>
<li class="tags">
<ul>
<li><a href="#">Learn</a></li>
<li><a href="#">Code</a></li>
<li><a href="#">HTML</a></li>
<li><a href="#">CSS</a></li>
</ul>
</li>
</ul>
</div>
<div class="description">
<h1>Learning to Code</h1>
<h2>Opening a door to the future</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad eum dolorum architecto obcaecati enim dicta praesentium, quam nobis! Neque ad aliquam facilis numquam. Veritatis, sit.</p>
<p class="read-more">
<a href="#">Read More</a>
</p>
</div>
</div>
Javascript Code
$(document).ready(function () {
$("#search").on("keyup", function () {
var value = $(this).val().toLowerCase();
$(".blog-card .description h1").filter(function () {
$(this).parent(".description").parent(".blog-card").toggle($(this).text().toLowerCase().indexOf(value) > -1)
});
});
});
add a comment |
HTML code
<input id="search" type="text" placeholder="Search.." />
<div class="blog-card col-sm-12 col-md-6">
<div class="meta">
<div class="photo" style="background-image: url(https://storage.googleapis.com/chydlx/codepen/blog-cards/image-1.jpg)"></div>
<ul class="details">
<li class="author"><a href="#">John Doe</a></li>
<li class="date">Aug. 24, 2015</li>
<li class="tags">
<ul>
<li><a href="#">Learn</a></li>
<li><a href="#">Code</a></li>
<li><a href="#">HTML</a></li>
<li><a href="#">CSS</a></li>
</ul>
</li>
</ul>
</div>
<div class="description">
<h1>Learning to Code</h1>
<h2>Opening a door to the future</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad eum dolorum architecto obcaecati enim dicta praesentium, quam nobis! Neque ad aliquam facilis numquam. Veritatis, sit.</p>
<p class="read-more">
<a href="#">Read More</a>
</p>
</div>
</div>
Javascript Code
$(document).ready(function () {
$("#search").on("keyup", function () {
var value = $(this).val().toLowerCase();
$(".blog-card .description h1").filter(function () {
$(this).parent(".description").parent(".blog-card").toggle($(this).text().toLowerCase().indexOf(value) > -1)
});
});
});
HTML code
<input id="search" type="text" placeholder="Search.." />
<div class="blog-card col-sm-12 col-md-6">
<div class="meta">
<div class="photo" style="background-image: url(https://storage.googleapis.com/chydlx/codepen/blog-cards/image-1.jpg)"></div>
<ul class="details">
<li class="author"><a href="#">John Doe</a></li>
<li class="date">Aug. 24, 2015</li>
<li class="tags">
<ul>
<li><a href="#">Learn</a></li>
<li><a href="#">Code</a></li>
<li><a href="#">HTML</a></li>
<li><a href="#">CSS</a></li>
</ul>
</li>
</ul>
</div>
<div class="description">
<h1>Learning to Code</h1>
<h2>Opening a door to the future</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad eum dolorum architecto obcaecati enim dicta praesentium, quam nobis! Neque ad aliquam facilis numquam. Veritatis, sit.</p>
<p class="read-more">
<a href="#">Read More</a>
</p>
</div>
</div>
Javascript Code
$(document).ready(function () {
$("#search").on("keyup", function () {
var value = $(this).val().toLowerCase();
$(".blog-card .description h1").filter(function () {
$(this).parent(".description").parent(".blog-card").toggle($(this).text().toLowerCase().indexOf(value) > -1)
});
});
});
answered Nov 25 '18 at 7:30
m.nabilm.nabil
86
86
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53427484%2fhow-to-search-with-javascript%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Can you add a minimal code that you've tried so far? So that we can understand the problem thoroughly...
– CodeBlaze
Nov 22 '18 at 9:21
show us your html code
– לבני מלכה
Nov 22 '18 at 9:23
i added html code
– m.nabil
Nov 22 '18 at 9:25
Where and what is the element with the id
myInput
? It's not in your code– HerrSerker
Nov 22 '18 at 9:36
before the div tag
– m.nabil
Nov 22 '18 at 9:43