Contoh pemakaian javascript confirm() pada jquery:
button:
<input type=\"button\" id=\"btndel\" class=\"delete\" value=\"Delete\" name=\"delete\" alt=\"aku\">
jquery script:
<script>
$(document).ready(function(){
button:
<input type=\"button\" id=\"btndel\" class=\"delete\" value=\"Delete\" name=\"delete\" alt=\"aku\">
jquery script:
<script>
$(document).ready(function(){
$(".delete").click(function(){
var nama = $(this).attr('alt').toUpperCase();
var x = confirm("Menghapus User " + nama)
if(x){
alert("Lanjutkan")
}
})
})
</script>
0 comments:
Posting Komentar