Hello, I don’t understand how to pass the value of my slider to a string like my first example. I am new to javascript and I have a little trouble with it.
var var_t7_bouton_tare = document.getElementById(“id_t7_bouton_tare”),
var_demo =document.getElementById(“demo”);
var_t7_poid_slider = document.getElementById(“id_t7_poid_slider”),
var_id_t7_textSliderValue = document.getElementById(“id_t7_textSliderValue”);
// var_id_t7_boutton_valider = document.getElementById(“id-t7_boutton_valider”);
//var_id_t7_bouton_parametrage = document.getElementById(“id_t7_bouton_parametrage”);
var_t7_bouton_tare.addEventListener(“click”, function()
{
var_demo.innerHTML = “Hello World”;
websocket.send(‘tare’);
});
var_t7_poid_slider.addEventListener(“input”, function()
{
var_id_t7_textSliderValue.innerHTML = var_t7_poid_slider.value;
websocket.send(“t7_poid_slider” + var_id_t7_textSlider.value);
//websocket.send(“t7_poid_slider”);
}, false);
2 Answers
Solved with toString()
websocket.send(“t7_poid_slider” + var_t7_poid_slider.value.toString());