<script id="template" type="text/template"> <!-- 模板部分 --> <!-- 模板结束 --> </script> $("#templte").html();
Remarks: The difference between the html() method and text(), html takes the html content (including tags) in the selector, while text( )Get only the text of the document in the selector (not including tags)
<pre name="code" class="html"><script id="template" type="text/x-template"> <!-- 模板部分 --> <!-- 模板结束 --> </script>
<pre name="code" class="html"><script id="template" type="text/html"> <!-- 模板部分 --> <!-- 模板结束 --> </script>
#
<template id="template"> <!-- 模板部分 --> <!-- 模板结束 --> </template >
CDATAThis thing is unique to XML. The content in it will not be parsed by the XML parser. You can understand it as Metadata
Prevent bubbling:
event.stopPropagation(); // 阻止事件冒泡
Prevent default behavior:
event.preventDefault(); //阻止默认行为 ( 表单提交 )
Also prevent event bubbling Bubbles and default behavior:
return false;
The above is the detailed content of Detailed explanation of the use of