在我的 php 项目中,我有一个 javascript 变量说“addText”,其中包含以下 html 内容
<div class="foxcontainer" style="width:100% !important;">
<h2>FREE IN HOME CONSULTATION</h2>
<ul class="fox_messages">
<li>Invalid field: Your name</li>
<li>Invalid field: Your email</li>
</ul>
<form enctype="multipart/form-data" class="foxform" action="/hima/bigriglawgroup/index.php/about-us#mid_131" method="post">
<!-- mod_foxcontact 2.0.19 GNU/GPLv3 -->
<div class="foxfield">
<input class="invalidfoxtext" value="Your name" title="Your name" style="width:85% !important;display:block;float:none;margin:0 auto !important;" name="_c31f7a92d344f9a5c23d07fd438ba0b6" onfocus="if(this.value==this.title) this.value='';" onblur="if(this.value=='') this.value=this.title;" type="text">
<span class="asterisk"></span>
</div>
<div class="foxfield">
<input class="invalidfoxtext" value="Your email" title="Your email" style="width:85% !important;display:block;float:none;margin:0 auto !important;" name="_4fd8a7bb907c63baca708086b63eb7f0" onfocus="if(this.value==this.title) this.value='';" onblur="if(this.value=='') this.value=this.title;" type="text">
<span class="asterisk"></span>
</div>
<div class="foxfield">
<input class="validfoxtext" value="Phone number" title="Phone number" style="width:85% !important;display:block;float:none;margin:0 auto !important;" name="_68a05eb930e9ce854ed0c2d2d25c14a1" onfocus="if(this.value==this.title) this.value='';" onblur="if(this.value=='') this.value=this.title;" type="text">
</div>
<div class="foxfield">
<textarea rows="" cols="" class="validfoxtext" name="_0ef408e84316ef5737db72a727579f48" title="Notes" style="width:85% !important;height:180px !important;display:block;float:none;margin:0 auto !important;" onfocus="if(this.value==this.title) this.value='';" onblur="if(this.value=='') this.value=this.title;">retret ret ret ret</textarea>
</div>
<div class="foxfield">
<button class="foxbutton" type="submit" style="margin-right:32px;" name="mid_131">
<span>Submit</span>
</button>
</div>
<div class="fox-copyright" style="padding:10px 0 !important;text-indent:0 !important">
<a target="_blank" title="Joomla contact form" href="#" style="display: none !important; display: inline !important; font-size:10px !important;">powered by fox contact</a>
</div>
</form>
</div>
在这里,我想检查该内容中是否存在字符串“无效字段”。如果它不存在,我想做一些其他功能。但我不知道该怎么做
有人知道吗?请帮助我ASPS。
提前致谢