Refresh Div With Javascript Button
Creating an APP in dreamweaver. How do I make it so a particular DIV will reload/refresh when the user clicks a button.
Solution 1:
Consider You have a button with id refresh, and the div your want to reload has id div. Once your click on the button it will load the div with the following JQuery
<input type='button' name ='click me' id="refresh" /
<script>
$(function() {
$("#refresh").on("click", function() {
$("#mydiv").load("index.html")
returnfalse;
})
})
</script>
Solution 2:
In Jquery
<button id="MyButton">Refresh</button>
$(document).ready(function () {
$("#myButton").on("click", function () {
$("#div").load("index.php")
});
});
Post a Comment for "Refresh Div With Javascript Button"