p
元素是网站上段落文本的首选元素。 p
是“段落”的缩写。你可以创建一个这样的段落元素: <p>I'm ap tag!</p>
h2
元素下面创建一个p
元素,并为其指定文本“Hello Paragraph”。 p
元素。
testString: 'assert(($("p").length > 0), "Create a p
element.");'
- text: 你的p
元素应该有文本“Hello Paragraph”。
testString: 'assert.isTrue((/hello(\s)+paragraph/gi).test($("p").text()), "Your p
element should have the text "Hello Paragraph".");'
- text: 确保您的p
元素具有结束标记。
testString: 'assert(code.match(/<\/p>/g) && code.match(/<\/p>/g).length === code.match(/p element has a closing tag.");' ```