Monday, 15 February 2010

php - strip_html - how to select/allowed specific tag -



php - strip_html - how to select/allowed specific <p> tag -

<p data-p-id="787f8218ddeb003c4e4115791dbd3d64">i want select text</p> <p data-p-id="fffa2fbdd488d59cd9006f69c502da0c">and text</p>` <p data-p-id="8283e3fcff081b550ad589abf1c97d96">and text</p> <p data-p-id="9a20d2be577597b30b603e168918384e">this text also</p>

i want select <p> tag data-p-id on it. how can in jquery or strip_html in php?

please help...sorry poor english!

php's strip_tag — strip html , php tags string.

if want select p tag , data-p-id on each p tag, do:

<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.min.js"></script> <script type="text/javascript"> // when page loads $(function() { $('p').each(function() { console.log('data-p-id = ' + $(this).attr('data-p-id')); }); }); </script> <p data-p-id="787f8218ddeb003c4e4115791dbd3d64">i want select text</p> <p data-p-id="fffa2fbdd488d59cd9006f69c502da0c">and text</p> <p data-p-id="8283e3fcff081b550ad589abf1c97d96">and text</p> <p data-p-id="9a20d2be577597b30b603e168918384e">this text also</p>

check console output , see this:

php jquery

No comments:

Post a Comment