Tuesday, January 30, 2018

Write a program for a background color in angularJS.

Change the color of the input box by changing its value:

Program
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js">
</script>
</head>
<body>
<div ng-app="" ng-init="myCol='Red'">
<input style="background-color:{{myCol}}" ng-model="myCol" value="{{myCol}}">
</div>
</body>
</html>

Output


0 comments:

Post a Comment

Thanks For Commented.

TechTalk