Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. <p class="rowBox">
  2. <label>Text box</label>
  3. <input type="text"
  4. id="myText"
  5. value="text here" /> <--- want to insert local storage to replace "text here"
  6. </p>
  7.  
  8. javascript file containing this:
  9.  
  10. function getFirstRow() {
  11. let firstRow = Number(JSON.parse((<HTMLInputElement>document.getElementById('myText')).value)) + 3;
  12. if (isNaN(firstRow) || firstRow > rowCount || firstRow < 4 || firstRow == undefined || firstRow == null || firstRow > rowCount || !(typeof firstRow === 'number' && (firstRow % 1) === 0)) {
  13. return '3:';
  14. } else {
  15. localStorage.startRow = JSON.stringify(firstRow);
  16. return firstRow + ':';
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement