javascript - How can i insert a value in textbox -


hi guys possible can insert value jquery.

this code of html , jquery please me thank in advance!!!

< script >    $(document).ready(function() {      $("#oroom").blur(function() {        var oroom = $("#oroom").val();        var capa = $("#rcapa").val();        if (oroom.lenght == capa.lenght) {          $("#rcapa").html("capacity of 1 - 16 person");        }      });    }); < /script>
<div class="form-group" style="margin-left:100px;">    <div class="col-sm-10">      occupied rooms:      <select class="form-control" name="room" id="oroom">        <option>occupied room</option>        <option id="1room">1 room</option>        <option>2 rooms</option>        <option>3 rooms</option>      </select>    </div>  </div>  <div class="form-group" style="margin-left:100px;">    <div class="col-sm-10">      rooms capacity:      <input type="text" class="form-control" id="rcapa" disabled>    </div>

.html() use set/get html content while .val() use get/assign value control

$("#rcapa").html("capacity of 1 - 16 person"); //insert html 

use one

$("#rcapa").val("capacity of 1 - 16 person"); // assign value control 

Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -