I have four tabs and this input text is located in the second tab view. I have two buttons (back and next). When I'm in last tab, I want to retrieve value from this input text when pressing next button, but it always gives a null or undefined value, I don't know how to solve it. I have a text box with html code like this :
<div class="container-fluid add-report-field" style="background-color:white">
<div class="tabbable js-report-tab-container" >
<div class="tab-content">
<div class="tab-pane" id="tab1">
<div class="form-group">
<label>Report Title</label>
<input type="text" name="js-report-title-step-2" id="js-report-title-step-2" class="form-control js-report-title-step-2" placeholder="Report Title" value="Report Title">
</div>
</div>
</div>
</div>
I just try to retrieve it's value. I have tried this in my console.log :
console.log($("input[name=js-report-title-step-2]").val());
console.log($("#js-report-title-step-2").val());
console.log($("#js-report-title-step-2").text());
console.log($(".js-report-title-step-2").attr("value"));
console.log($("input:text").val());
but none of above ways work for me
What's the problem here...???