Replacing an element with a specific attribute and its value
:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title></title>
<style type="text/css"><!--
--></style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript"><!--
$(function(){
$("font").replaceWith(function(){
var font = $(this);
return $("<abbr></abbr>")
.attr("style", font.attr("style") )
.append( font.contents() );
});
});
//--></script>
</head>
<body>
<p>
lorem ipsum lorem ipsums <font style="background-color:yellow">ipsum</font> ipsume lorem
</p>
</body>
</html>
, , , .