I've got a dropdown and I need to put values in there that need to be escaped with javascript.
The reason why I want to use javascript is because the api I query is working with javascript and don't receive the other ways to escape quotes.
Exemple of dropdown value : "ToxKeywords:"genotoxicity" AND ToxKeywords:"ames" OR ToxKeywords:"micronucleus""
So i got this dropdown :
<form method="post" name="query">
<label for="textQuery">Choose Query from list</label>
<select class="form-control space" name="textQuery" id="textQuery">
<option selected disabled>Choose here</option>
<option value="ToxKeywords:">ToxKeywords</option>
<option value="Molecules.Main_name:">Molecule</option>
<option value="Query1">Query 1</option>
<option value=ToxKeywords:systemic toxicity>Query 2</option>
<option value=ToxKeywords:"phototoxicity">Query 3</option>
<option value=ToxKeywords:"llna">Query 4</option>
</select>
And i want to replace for exemple value="Query1" with javascript.
I tried this :
<script>
document.getElementById("textQuery").selectedindex = "Query 1"
select.option.value = "ToxKeywords:\"genotoxicity\" AND ToxKeywords:\"ames\" OR ToxKeywords:\"micronucleus\"";
</script>
Apparently i can select the right value but i don't know how to change it to : "ToxKeywords:\"genotoxicity\" AND ToxKeywords:\"ames\" OR ToxKeywords:\"micronucleus\""
Can you help me to find the right Javascript syntax ?