confirm() event.target.getAttribute('id')

w

<?php
$wecho = '<form id="del' . $wid . '" method="POST" action="" > <input type="hidden"     name="del"   value="' . $one[$wii . 's' . 'id'] . '"   > <span   id="js' . $wid . '"  onclick="w_js_confirm()" >&times;</span></form>';
echo $wecho;
?>
<script>
    function w_js_confirm() {
        var even_ttarget_getAttributeID = event.target.getAttribute('id')
        var form_id = even_ttarget_getAttributeID.replace(/js/, 'del')
        console.log(form_id)
        var wr = confirm('您确定删除该预订信息?');
        console.log(wr);
        if (wr == true) {
            document.getElementById(form_id).submit();
        }
    }
</script>

 

posted @ 2017-03-01 12:01  papering  阅读(429)  评论(0编辑  收藏  举报