javascript – Trying change css content with jquery but not working

0
51
html - Animation after toggling doesn't apply the second style


I have this configuration on h3 tag

<style>
h3 {
    text-transform: uppercase;
}

h3::before{
    font-family: "Font Awesome 5 Free";
    content: "f041"
}
</style>

And when I wanna change this on jquery event

<script>
$(document).ready(function(){
  $("#enviar").click(function(){   
    var unicode = $('#uunicode').val();
    var cor = $('#ccor').val();
    var tamanho = $('#ctamanho').val();
    $('#testando').css({
    'content': unicode,
    'color': cor,
    'font-size': tamanho
    });
    alert($('h3').css('content'));
   });
    
 });

</script>

The alert content return me “normal”, all the others css atributes is working, just the “content” attr is not working, someone know’s why?

This image is for if someone have curiosity to see what I wanna do



Source link

Leave a reply

Please enter your comment!
Please enter your name here