ID属性值为小数

获取带有.的id值

<h1 id="123.45">dom对象</h1>

  

<script>
$('#123\.45').attr('id') //123.45
</script>

  

<script>
$('#123.45').attr('id')   //undefined
</script>

  

原文地址:https://www.cnblogs.com/dfghjkl/p/5403981.html