JSFiddle - React, Tailwind, and code Playground
HTML
<span id="1">Ce texte devrait être en rouge !</span>
<input type="button" value="Appliquer les style en JavaScript" id="setStyle" />
CSS
#1{
font-weight: bold;
color: red;
}
JavaScript
function setStyle(){
document.getElementById('1').style.fontWeight = 'bold';
document.querySelector('#1').style.color = 'red';
}
document.getElementById('setStyle').onclick = setStyle;