|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-04-17 22:51 UTC] sathia dot musso at gmail dot com
Description:
------------
I know there's no such attribute value="" but you can't access the content ($textarea->textContent will not work as well) of that if the content inside is wrapped within "lt" and "gt" <textarea><won't read></textarea> (ie when you read embed tags from textarea)
Reproduce code:
---------------
$documentx = new DOMDocument();
$documentx->loadHTML($data);
$textareas = $documentx->getElementsByTagName("textarea");
foreach($textareas AS $textarea){
print($textarea->getAttribute("value"));
}
<textarea><img src="foobar" /></textarea>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 01:00:01 2025 UTC |
this should help to understand, in Javascript you can access this strange attribute <textarea id="pippo"></textarea> <script> document.getElementById('pippo').value = "<embed embed>"; alert(document.getElementById('pippo').value); </script> this work as expected, in php you can't do that. (i know that javascript is a client side script, I use it just as an example of a DOM abstraction)