Reputation: 7599
i'm trying to figure out how to set elements invisible using the parser. here's what i tried which didn't work unfortunately:
$button->style = "display:none";
any ideas? thanks
Upvotes: 1
Views: 2838
Reputation: 198117
I don't know which parser you're using, but if you want to hide some HTML element, you need to set the style
attribute to display:none
.
So access the style
attribute of that button
and set it / extend it with display:none
.
According to the reference given at http://simplehtmldom.sourceforge.net/ (if that is the component you're using), this should do it:
$dom->find("button[id=save]",0)->style = 'display:none';
Upvotes: 1
Reputation: 10074
Use set setAttribute method http://php.net/manual/en/domelement.setattribute.php
$button->setAttribute("style", "display:none");
Upvotes: 3