Modifier un "span" de nom de classe connu
Bonsoir.
En cette fin de journée, je ne vois pas ce qui ne marche pas dans mon bout de code ci-dessous. :calim2:
Quelqu'un a-t-il une meilleure vision des choses que moi ? Je sens une erreur pathétique de ma part... :roll::aie::mouarf:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<section>
<p>
Un bout de code Python :
<span class="inlinecode">for i in range(4): print(i)</span>.
Fin du bout de code.
</p>
</section>
</body>
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script>
jQuery(document).ready(
jQuery.each(
jQuery("span.inlinecode"),
function() {
var code = jQuery(this).html();
jQuery(this).html(
'<span style="color:red;">' + code + '</span>'
);
}
);
);
</script>
</html> |