I don't know much about advanced html or whatever but in BASIC you would use something like:
if X<0 then X=0