December 18, 2006
Well, I didn’t know about this, so here goes.
It’s possible to delete object, properties of objects or places in arrays with delete.
delete objectName
delete objectName.property
delete objectName[index]
Read more about this, and other useful special operators over at the Mozilla developer center
Leave a Comment » |
JavaScript, Tip |
Permalink
Posted by perihelion
December 17, 2006
This will be my first real post, I decided to make it a small tip just to get things off.
It’s possible to declare multiple classes for an element using a space-separated list
<p class="strong em">paragraph</p>
This will make the element respond to both class-values for the CSS, making the above paragraph text both bold and italic.
p.strong {
font-weight: bold;
}
p.em {
font-style: italic;
}
It’s also possible to target elements that only carries both values, using a dot between all the class-attributes you want to catch. In this case, all paragraphs that have class-values of both strong and em will also get a red background.
p.strong.em {
background: red;
}
Leave a Comment » |
CSS, Tip |
Permalink
Posted by perihelion