首页 > 代码库 > confirm() event.target.getAttribute('id')

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

w

<?php
$wecho = ‘<form id="del‘ . $wid . ‘" method="POST" action="" > <input type="hidden"     name="del"   value="http://www.mamicode.com/‘ . $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>

 

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