I'm trying to make a select
from a ID
that will be caught in the value
of a option
, I searched the net and saw that they put this inside a function, but when I put the function, the variable that should store the value, simply does not work anymore.
In this way the code works and even gets to the value, but it does not work in select
of the DB, everything I tried to do always stops working.
var myTest = document.getElementById("list").value;
db.transaction(function(tx) {
tx.executeSql(
'SELECT * FROM exercicios WHERE se_id = ?', [myTest],
function(tx, results){
var exlist = document.getElementById("exlist");
for(var i = 0; i < results.rows.length; i++) {
var row = results.rows.item(i);
exlist.innerHTML += "<li>" + row.se_id + " - " + row.ex_nome + "</li>";
}
}
);
});