Well the title says it all but here is some code so you see what i mean.
function eachFeature(feature, layer) {
layer.on({
mouseover: highlight
Something like this should do the trick. feature._container exposes the underlying DOM element, so you can use regular DOM operations on it (e.g. classList on modern browsers, or setAttribute('class', 'someClass') in older browsers).
function eachFeature(feature, layer) {
// Need to use setTimeout hack so the DOM container will be
// available. WARNING: may cause race condition issues,
// maybe tie into some other timing event?
window.setTimeout(function() {
feature._container && feature._container.classList.add('someClass');
}, 0);
}
geojson = L.geoJson(geojson_raw, { onEachFeature: eachFeature });
geojson.addTo(map);