I have a question abbout video assignment, when user enter a fruit and it pushs to array.
I always gat undefened value from input textbox? Anybody know why?
<input placeholder="WriteFruit" type="text" id="inpTxt"/>
<button id="buttonFr">Add a fruit</button>
<script>
var fruits=["Banana", "Orange"];
var list= $("#fruitOrdList");
$("#buttonFr").click(function(){
/* fruits.push($("inpTxt").val()); */
var adFruit = $("inpTxt").val();
alert(adFruit);
console.log("ButtonPushed");
});