[Solved] Create textbox dynamically in td next to specified td in html table using jquery

Try something like this, it will remove 1st textbox when you click on 2nd option. Jquery code <script> $(document).ready(function(){ $(“.radio_action”).click(function(){ if($(this).val() == “E” ){ $(“#other_text”).html(“”); $(“#emp_text”).html(“<input type=”text” >”); } else if($(this).val() == “A” ) { $(“#emp_text”).html(“”); $(“#other_text”).html(“<input type=”text” >”); } }) }); </script> HTML code <table> <tr> <td><input type=”radio” name=”radio_type” value=”E” class=”radio_action” /> Employee</td> <td … Read more

[Solved] Save advert click to database using PHP, then open link

You will want to do something like $(function() { $(“.advertLink”).on(“click”,function(e) { e.preventDefault(); // stop the link unless it has a target _blank or similar var href = this.href; var id=this.id; // or $(this).data(“advertid”) if you have data-advertid=”advert1″ on the link $.post(“./wp-content/plugins/facilitaire-advert-widget/save-advert-click.php”, { “action”:”call_this”, “advert_ID”:id }, function() { location=href; // or window.open } ); }); }); … Read more

[Solved] Unstoppable loop [closed]

Here, you will need to add your URL calling code tho. let arrUrls = [ [“URL1”, 4], [“URL2”, 10], [“URL3”, 8], [“URL4”, 9], [“URL5”, 6] ]; let sendNum = 0; function callUrl(url, rpt){ for (let i = 0; i < rpt; i++) { // calling code console.log(`called ${url} – ${i}/${sendNum}`); } }; let x = … Read more

[Solved] How to animate a div move horizontally when page is scroll down? [closed]

Since you included the jQuery tag, I’ll give you a jQuery-based solution. First, let’s set up some structure for the example: HTML <div class=”sample red”></div> <div class=”sample green”></div> <div class=”sample blue”></div> <br> <div class=”new”>aaa</div> The three “sample” divs are the ones that’ll animate as we scroll. “new” is the content. CSS .sample { width:100px; height:300px; … Read more

[Solved] Jquery add li class active

try this JQUERY first give the id to your ul <ul class=”nav nav-tabs” id=”nav_tabs”> then use jquery $(document).ready(function(){ $(‘ul#nav_tabs li a’).each(function(index, element) { var li = $(element).attr(‘href’); $(element).parent().removeClass(“active”); var filename = window.location.href.substr(window.location.href.lastIndexOf(“https://stackoverflow.com/”)+1); if(filename==li) { $(element).parent().addClass(“active”); } }); }); also you can use PHP as <?php $my_url = $_SERVER[‘REQUEST_URI’]; $page = substr($my_url, strrpos($my_url, “https://stackoverflow.com/”) + 1) … Read more

[Solved] CSS Problem behind content not clickable [closed]

You placed the top panel above the other item using the z-index. You can fix it by giving the #head a higher z-index and removing the background-color #head { top: 5px; right: 0px; width: 100%; position: fixed; border: 1px solid #336; border-bottom: 0px; background-color: #404040; //REMOVE THIS margin: 0; z-index: 2000; //ADD THIS } solved … Read more

[Solved] How to define my variable structure?

Notice that the object presented by @juvian does not have a defined ordering of the keys (in contrast to PHP associative arrays, for example). I guess you want an ordered collection, for which you have to use an array: var collection = [ {‘title’: ‘1’, ‘subtitle’:’sub1′, ‘contents’:’sub content 1′}, {‘title’: ‘2’, ‘subtitle’:’sub2′, ‘contents’:’sub content 2′}, … Read more

[Solved] “Cannot read property … of undefined” in jQuery 1.11.0 — how can I satisfy jQuery’s requirement?

You have incorrect syntxis What do you whant to do with ? jQuery(function() { jQuery.each(jQuery(‘h1’).add(‘h2’).add(‘h3’).add(‘h4’).add(‘h5’).add(‘h6’).add(‘ul#navigation’)).function(index, element) { var bounds = jQuery(element).offset(); var image_left = bounds.left; var image_top = bounds.top + bounds.height; var image = jQuery(‘<img src=”https://stackoverflow.com/media/images/foldback.png”>’); image.style.position = ‘absolute’; image.style.top = image_top + ‘px’; image.style.left = image_left + ‘px’; } function set_search_width() { var offset … Read more

[Solved] javascript replace \/ or /\ to single slash /

Because a backslash is used as an escape character, you’ll need to escape it: str = str.replace(“\\/”, “https://stackoverflow.com/”); The above replaces \/ with /. In general, anywhere you use a backslash in a string, you probably need to escape it. So, to replace /\ with /, you’d use: str = str.replace(“/\\”, “https://stackoverflow.com/”); These will, of … Read more

[Solved] Validation without regex

Use Date.parse() to test date strings. As for testing alpha-numeric strings without regex, write a loop to go through the characters of the strings to see of a character is there that shouldn’t be. solved Validation without regex