嗨, $form
持有该...php DOMDocument:表单元素的完整转换?包装和删除?
<form method="post" action="">
<input type="hidden" name="ip" value="127.0.0.1">
<label for="s2email">Your Email</label>
<input type="text" name="email" id="s2email" value="email..." size="20" onfocus="if (this.value == 'email...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'email...';}">
<input type="submit" name="subscribe" value="Subscribe">
<input type="submit" name="unsubscribe" value="Unsubscribe">
</form>
因为我不知道什么是可能与DOMDocument
类,我需要寻求帮助。 我实际上有两件事情需要在上面的$ form上转换。
1.)label-s2email and its input#sd-email
应该被包装在一个<div class="name">
是甚至可以选择这两个(通过id或for-attribute)并将这两个包装到一个div?
2.)是否可以使用php删除onfocus和onblur属性?
感谢你的帮助
*(相关)* [最佳方法解析HTML](http://stackoverflow.com/questions/3577641/best-methods-to-parse-html/3577662#3577662)和[关于'DOMDocument'的Noob问题在PHP中](http://stackoverflow.com/questions/4979836/noob-question-about-domdocument-in-php/4983721#4983721) – Gordon 2011-03-24 09:27:14