Us image src url in CSS background image url using javascript or jquery

I’m novice at Javascript. I want to use an image src in CSS background image url using javascript. For example, <img class="user-profile-box-img" src="https://img.freepik.com/free-photo/portrait-young-man-using-mobile-phone-while-standing-outdoors_58466-16294.jpg"/&gt; This is an image src to show image. I want to use the same image url in css background-image: url(""), so that I don’t need to write twice the same url. How… Read More Us image src url in CSS background image url using javascript or jquery

How to know the value of a live radio button with javascript

I’m trying to retrieve the value of a radio button without validation or button. When the user changes the radio button I want to retrieve the live value. I have already tried a lot of code but none worked. var az = document.querySelector(“input[name=’promotioncases’]”).checked = true; console.log(az); var selectedValue = $(“input.promotioncases:checked”).val(); console.log(selectedValue); var selectedRadioValue = $(“input.promotioncases:checked”).attr(“radio-value”);… Read More How to know the value of a live radio button with javascript

how to change placement of input and its value with jquery

I’m using .html() to get inputs inside a div and place it in another element using .html() again the problem is I cant get it with its value. $(“#myButton”).click(function(){ $(“.element2”).html($(“.element1″).html()); }); <script src=”https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js</script&gt; <div class=”element1″> <input type=”text” placeholder=”enter something then clone it!”/> </div> <div class=”element2″></div> <button id=”myButton”>click to clone</button> >Solution : To copy one element… Read More how to change placement of input and its value with jquery

hide button based on condition with jquery

I have a page with a table containing customer data like customer name, quantity, price, and status. The Table looks like this: <table> <tr> <th>No</th> <th>Customer</th> <th>Quantity</th> <th>Price</th> <th>Status</th> <th>Action</th> </tr> <tr> <td>1</td> <td>Customer 1</td> <td>5000</td> <td>100000</td> <td class="status-order">Order</td> <td> <a class="btn btn-outline-primary">Update</a> <a class="btn btn-outline-danger">Delete</a> </td> </tr> <tr> <td>2</td> <td>Customer 2</td> <td>2000</td> <td>40000</td> <td… Read More hide button based on condition with jquery

How do I continue executing my .js code after programmatically adding jQuery to the DOM?

How do I continue executing my .js code after programmatically adding jQuery to the DOM? The 3rd answer in this post shows how to add jquery to the dom but how should you continue executing further code? For example you can’t just add code underneath the self invoked function because jQuery hasn’t yet loaded. How… Read More How do I continue executing my .js code after programmatically adding jQuery to the DOM?