TEMPLATE NODE: javascript in html

#1

Hi all,
I can't execute the check() function.
Any idea?
Thanks a lot

`<html>
<head>
	<script type="text/javascript">
        function check() {
        document.getElementById("myCheck").checked = true;
        }

        function uncheck() {
        document.getElementById("myCheck").checked = false;
        }
    </script>`

style> body { font-family: Arial, Helvetica, sans-serif; box-sizing: border-box; }

	.textformat1 
	{
		font: bold 16px sans-serif; 
		color: black;
		margin-top: 18px;
		margin-bottom: 0px;
		width: 100%;
	}

	.textformat2 
	{
		font: bold 12px sans-serif; 
		color: gray;
		margin-top: 3px;
		margin-bottom: 0px;
		width: 100%;
	}

	.w3-card-4
	{
		width: 100%;
		margin-top:0px;
		margin-bottom:0px;
	}

	.w3-container_titolo
	{
		padding:0.01em;
		margin-top:0px;
		margin-bottom:5px;
		width: 100%;
	}

	.w3-container
	{
		padding:0.01em;
		margin-top:5px;
		margin-bottom:10px;
		width: 100%;
	}

	.w3-green
	{
		color:#fff!important;
		background-color:#4CAF50!important;
	}

	.w3-input
	{
		padding:8px;
		display:block;
		border-radius: 15px;
		width:85%;
		margin-top:5px;
		margin-bottom:13px;
	}
	
	.w3-sand
	{
		color:#000!important;background-color:#fdf5e6!important;
	}
</style>
</head>

<body>
	<div class = "w3-card-4">
		<div class = "w3-container w3-green">
			<h3>Input Colors</h3>
		</div>
		<form class = "w3-container">
			<table class = "w3-container">
				<tr>
					<td>
						<label class = "textformat1"><b>First Name</b></label>
					</td>
				</tr>
				<tr>
					<td>
						<label class = "textformat2"><b>Inserire il diametro</b></label>
					</td>
				</tr>
				<tr>
					<td>
						<input class = "w3-input w3-sand" placeholder = "{{msg.payload}}" name = "first" type = "text" value = "{{msg.payload}}" ng-model = "myfirst">
					</td>
					<td>
						<input name = "firstBox" type = "checkbox" id = "myCheck" ng-model = "mycheck"> 
					</td>
				</tr>
				
				<tr>
					<td>
						<label class = "w3-text-brown"><b>Last Name</b></label>
					</td>
				</tr>
				
				<tr>
					<td>
						<input class = "w3-input w3-sand" placeholder = "Last"  name = "last"  type = "text" ng-model = "mylast">
					</td>
					<td>
						<input name = "lastBox" type = "checkbox" (msg.payload)>
					</td>
				</tr>
			</table>
			<md-button ng-click="send({payload: {first: myfirst, last: mylast, check: mycheck}})"> Send values </md-button>
		</form>
	</div>
    <script type="text/javascript">
        check();
	</script>
</body>
`
0 Likes