0
How to make Button image
Wanna create a button that hide and show image whenever it is clicked.
6 ответов
+ 4
AbdulRasheed Lekan Adekeye
Here replace <p> with <img>
https://code.sololearn.com/WOhWj5qPvT7b/?ref=app
For DOM manipulation use jQuery,it will make it easy
$("button").on("click", ()=>{
$("img").toggle()
})
+ 1
Can you show us your attempt?
+ 1
Can you write anything then? Just a code that shows an image an a button at least.
+ 1
<!DOCTYPE html>
<html>
<head>
<script>
function myimg()
{
document.getElementbyId("click").innerHTML;
show.this("art.jpg");
}
</script>
<title>image</title>
</head>
<body>
<input id = "click" type="button" value ="Click Here"/>
</body>
</html>
0
No idea
0
Sudarshan Rai 👑 thanks it works