Demo - Assigner ou récupérer la valeur de la propriété CSS float via Javascript

Soit la balise ci-dessous :

test

→ voir la source HTML
<div style="clear:both; overflow:hidden; width:100%">
	<div id="floatme" style="float:right;">
		<p>test</p>
	</div>
</div>
→ voir le CSS
#floatme { 
	width:200px; height:200px; 
	margin:3em auto; padding:0;
	border:10px solid red; -moz-border-radius:.3em; -webkit-border-radius:.3em;
}
#floatme p { 
	width:200px; height:200px;
	margin:0; padding:0;
	background-color:#000;
	font-size:xx-large; line-height:200px;
	text-align:center; text-transform:uppercase; 
}
→ voir la source javascript
<script type="text/javascript">
function getFloat(elId) {
	var el = document.getElementById(elId), v = '';
	if (typeof el.style.styleFloat === 'string') {
		v =  el.style.styleFloat;
		alert('M$ mode = ' + v);
	}
	if (typeof el.style.cssFloat === 'string') {
		v =  el.style.cssFloat;
		alert('W3C mode = ' + v);
	}
}
function setW3CFloat(elId, value) {
	document.getElementById(elId).style.cssFloat = value;
}
function setIEFloat(elId, value) {
	document.getElementById(elId).style.styleFloat = value;
}
function setFloat(elId, value) {
	var el = document.getElementById(elId);
	el.style.cssFloat = value;
	el.style.styleFloat = value;
}
</script>