Horje
Javascript replace  div content onclick a button Code Example
Javascript replace div content onclick a button
<div id = "div1" style="display:block"><img src="1.jpg" /></div>

<div id = "div2" style="display:none"><img src="2.jpg" /></div>

<button type="submit" onclick = "replace()">change content</button>


<script type = "text/javascript">
function replace() {
document.getElementById("div1").style.display="none";
document.getElementById("div2").style.display="block";
}

</script>




Javascript

Related
convert curl response to json format and echo the data Code Example convert curl response to json format and echo the data Code Example
get all id from array of objects javascript Code Example get all id from array of objects javascript Code Example
selector for redux Code Example selector for redux Code Example
popover on show event Code Example popover on show event Code Example
load external javascript from console Code Example load external javascript from console Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7