Problem using html with font size

hello I’m trying to build a slider that changes the size of a text element using html but i’m unable to make a working html font size, I always have issue here is my code

$w('#text32').html= `<p style = "font-family:${font1},serif;font-size:"+${fontSize}+"px;text-align:center;"> ${$w('#input1').value}</p>`;

and

 
export function slider1_change(event) {
    fontSize=$w("#slider1").value

}

i think the issue is in how i handled the variable in the html of the text32

Thanks you in advance !

You need to put the

$w('#text32').html= ...

inside the slider1_change() function (after you retrieve the new value.

Yeah i do know that, but what i am asking is how you put a variable for the fontsize, because what i do doesn’t work

@jeuxgamerdu26 you should delete the + sign (before and after the variable)

Something like:

$w("#text35").html =`<p style = 'font-family:${font1},serif;'><span style='font-size:${fontSize}px;'><span style='text-align:center;'> ${$w("#input1").value}</p>`;