SEARCH:
Previous: Optional CSS Class Next: hElement

hTagParm

string parmname
string parmval
string HTML_fragment


This handy routine returns either an HTML property assignment or an empty string. It is a useful helper routine for building HTML element definitions when you don't know if the parameters being passed in are going to be empty.

So for instance, if you have been passed a value of $CSS_class which may be empty, you can call:

$class=hTagParm('class',$CSS_Class)

if the value passed to $CSS_Class is empty it will give you back an empty string, otherwise it will give you the string 'class="-CSS_Class-"'.

This allows for safe unconditional placement of $class into an HTML element definition.

Previous: Optional CSS Class Next: hElement