相关疑难解决方法(0)

使用jQuery选择HTML注释

有没有人知道如何用jQuery选择HTML注释节点?

<html>
<head>
    <title>Check Test</title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <script type="text/javascript">
        $(function() {
            $("body *").each(function() {
                alert($(this).wrap("<span />").parent().html());
            });
        });
    </script>
</head>
<body>
    <!-- Hello -->  
    <p>
        <label for="thing">Thing Label</label>
        <input id="thing" type="checkbox" />
    </p>
Run Code Online (Sandbox Code Playgroud)

这不会发表评论.

html jquery

68
推荐指数
4
解决办法
4万
查看次数

标签 统计

html ×1

jquery ×1