How can I save the currentvalue of a slider in a seperate variable in plotly js?

I have looked at various documentation and similar questions on here, but cannot seem to find the particular solution. Apologies if I have missed anything obvious or have repeated this question!

I am planning to implement a slider for a project I’m doing, which will be implemented in a survey software. I want to pass the input from the slider (currentvalue) to a variable which the survey program can process.

I found the option to include the argument customdata, however I’m not sure on how to save the input of my slider into this variable.

I would greatly appreciate help!

<!DOCTYPE html>