javascript - Making grids using JS or JQuery -


i'm new js , have been working through lessons via odin project. i'm on first js/jquery project , i'm having trouble project:

how use js/jquery user input number between 1-16 , grid pop out size of page. i.e. user types in 3 , 3x3 grid size of webpage comes out? or user types in 16 , 16x16 grid comes out?

i prefer not straight out answer, maybe if point me in right direction starter code? i'm guessing best approach create div , use .append() function? need little more direction here.

here cryptic response require. i've included fill-in-the-blanks , left out how expand table fill screen. hint: use $(window).height()/$(window).width() size of screen.

$('#grid').change(function(){      $('table').remove();      var code = "<table>";      (var = 0; < $('#grid').val(); i++)      {          code += "???";          (var j = 0; j < $('#grid').val(); j++)          {              code += "???";          }          code += "???";      }      code += "</table>";      $('#container').append(code);  });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>  <div id="container">      <label>grid size</label>      <input type="number" id="grid" />  </div>


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -