Sneha
Sneha

Reputation: 153

Code not giving expected result

When I was running my code it shows undefined with text box which I don't want to see. So I how I can remove that undefined word?

$scope.click1=function(){
      $scope.clicked1=!$scope.clicked1;
      $scope.val1=$scope.value1;
      document.getElementById("t2").innerHTML=$scope.val1;
  }
<span class="glyphicon glyphicon-pencil" id="t2" ng-click="click1()">Venue</span>
                    <input type="text" placeholder="write some details" ng-show="clicked1" ng-model="value1">

Upvotes: 0

Views: 42

Answers (1)

Antoine
Antoine

Reputation: 181

You have a variable called val1 and another value1. Normal ? Be sure that you're using the same value in each code (.js and .html)

Upvotes: 2

Related Questions