I am trying to pass text to JavaScript via document.getElementById. Specifically, I am trying to pass the value of the ID (set to "Jason_Example_12" in the example below). I can pass values that are integers, but am unable to pass text.
I have considered using innerHtml, but that does not get the value, it only gets what is between the <li> tags.
Any help would be appreciated!
Thanks!
<script type='text/javascript'>
function ajaxAssignFull() {
var assignment_string =
var assignment_string = document.getElementById('assignment_string_full').value
alert(assignment_string);
}
</script>
<li id="assignment_string_full" onclick='ajaxAssignFull()' value="Jason_Example_12"><a
href="#">Jason Example</a></li>
lielements don't have value attributes. Input elements do.