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.");' ```