Jquery we can use this to specify the current DOM

Jquery we can use this to specify the current DOM

 

jquery get and set its elements

<div class="shop-item" style="line-height: 30px" shopid="{$shop['id']}" shopname="{$shop['shopname']}" latng="{$shop['latng']}" address="{$shop['address']}"></div>
<script>
$('.shop-item').click(function () {
    $("input[name='e_shopid']").val($(this).attr('shopid'));
    $("input[name='e_shopname']").val($(this).attr('shopname'));
    $("input[name='e_latng']").val($(this).attr('latng'));
    $("input[name='e_address']").val($(this).attr('address'));
    $('.zp-mask-update').css('display', 'block');
});
</script>

 

Guess you like

Origin www.cnblogs.com/GetcharZp/p/11841112.html