I have a problem with adding custom javascript code in the Wordpress file "single.php" I follow these steps, but it didn't work How to add JavaScript to WordPress PHP file? I dont know if that's happening due to WordPress security purposes or not Btw, this is the javascript function
<script type="text/javascript">
function room_combobox() {
var text = "";
var i;
for (i = 0; i < 7; i++) {
text += "<option value=+i+>"+i+"</option>" +"<br>";
}
document.getElementById("combo").innerHTML = "<select name= “ room-adults ” id= “ single-room-adult-selection ” ><option><?php _e( “ No. adults ” , “ nation ” ); ?></option>"+text+"</select>";
}
</script>
Thanks!