Add attribute to the recently added input field in javascript

I have the following code which is hidden. <div id=”orderFields” style=”display: none;”> <table class=”table”> <tbody id=”more-tr”> <tr> <th style=”font-weight: bold”>Offer</th> <td class=”col-lg-6 col-md-6 col-sm-12″> <input type=”text” class=”form-control price” id=”offer” placeholder=”Offer title” value=”” novalidate> </td> <th style=”font-weight: bold”>Image</th> <td class=”col-lg-4 col-md-4 col-sm-12″> <img src=”” style=”max-width:40%;max-height:20%” /> <input type=”file” name=”image[]” style=”background: transparent;border: transparent”> </td> <td class=”col-lg-2 col-md-2…

How do I add a paragraph’s width with each click with Javascript?

I want to be able to add width to my paragraph with each click with Javascript. What am I doing wrong? Here is my code : let button = document.querySelector(“button”); button.addEventListener(“click”,function(e) { let p = document.querySelector(“p”); if(window.getComputedStyle(p).getPropertyValue(“width”)===”10px”) { p.style.width = “10px”; p++; } else { console.log(false) } }); p { box-shadow: 0 4px 8px rgb(0,0,0,0.4);…

Change javascript so it works for numerous variables

I have the following code below… It takes a search field, and quickly searches the table for matching items, and hides all the other results. Right now this code works for a single search field (with class .search), and a single table (with id #SearchableTbl). $(document).ready(function(){ $(‘.search’).on(‘keyup’,function(){ var searchTerm = $(this).val().toLowerCase(); $(‘#SearchableTbl tbody tr’).each(function(){ var…

Change javascript so it works for numerous variables

I have the following code below… It takes a search field, and quickly searches the table for matching items, and hides all the other results. Right now this code works for a single search field (with class .search), and a single table (with id #SearchableTbl). $(document).ready(function(){ $(‘.search’).on(‘keyup’,function(){ var searchTerm = $(this).val().toLowerCase(); $(‘#SearchableTbl tbody tr’).each(function(){ var…