htmll set element id code example
Example 1: js get id value
var element = document.getElementById("YourElementId");
var value_element = document.getElementById("YourElementId").value;
Example 2: html script id and class
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script class="foo" type="text/javascript">
function foobar() {
var a = 1;
}
</script>
<div id="showScript">Show me the script.</div>
<script type="text/javascript">
$('#showScript').click(function(event) {
event.preventDefault();
$("<div>").html($(".foo").text()).appendTo($("body"));
});
</script>