HTML: Here I have two inputs
<input id="range3" type="range" min="0" max="255" value="0" />
<input id="num3" min="0" max="255" type="number" value="0" />
<input id="range4" type="range" min="0" max="255" value="0" />
<input id="num4" min="0" max="255" type="number" value="0" />
JS: Here I get the result of the inputs and write it as html the result ; inplace of writing it as an result I want to execute it in linux.
// 30
var range3 = document.getElementById("range3");
var num3 = document.getElementById('num3');
range3.addEventListener('input', function (e) {
num3.value = e.target.value;
});
num3.addEventListener('input', function (e) {
range3.value = e.target.value;
});
// 40
var range4 = document.getElementById("range4");
var num4 = document.getElementById('num4');
range4.addEventListener('input', function (e) {
num4.value = e.target.value;
});
num4.addEventListener('input', function (e) {
range4.value = e.target.value;
});
function execute(){
document.getElementById("result").innerHTML = "asusctl fan-curve -m " + mode.value + " -D " + "30c:"+ num3.value + ",40C:" + num4.value + " -e true -f "+ unit.value ;
}
I want that that the result of execute function to be run as a linux command