[Solved] how to find a parent class and its children

Assuming you have the hierarchy as shown in your description and if, for example, you have the Order_Coupon element selected, you can get the coupon amount by the .children method. var amount=$(‘.Order_Coupon’).children().html(); Depending on what you have selected, you may have to use multiple calls of .child to find the coupon_amount element. var amount=$(‘.Order_Left’).children().children().children().html(); However, … Read more

[Solved] Hide class by default, show that class when clicking a link

You can use the functions addClass and removeClass to add or remove a class to your element. For example $(‘#myId’).addClass(‘myClass’); or $(‘#myId’).addClass(‘myClass’); where .myClass { display: none; } is, would add or remove the class myClass to an element with the id myId. Try this fiddle. Update: The fiddle is updated to remove a div … Read more

[Solved] jQuery onclick add textbox value to div using the ID’s

Thanks for editing the post… I would suggest first to add one class as an identifier to the Textbox and Div so we can attach event with the help of jQuery $(“<div class=”appendeddiv targetDiv_”+ roomcounter +””>Room-” + roomcounter + “</div>”).appendTo(“.housecontainer”); $(“<span>Room-” + roomcounter + ” name</span>&nbsp;<input type=”text” placeholder=”name” id=’room-” + roomcounter + “-id’ lang=’textInput’ class=”targetText_”+ … Read more

[Solved] Displaying selected dropdown option [closed]

This is a very simple task and you shouldn’t need php or jquery =) Here’s a quick solution that may work for you: HTML: <select> <option value=”foo”>foo</option> <option value=”bar”>bar</option> </select> <div></div> JS: var select = document.querySelector(“select”); var div = document.querySelector(“div”); select.onchange = function(e){ alert(this.value); div.innerText = this.value; }; Example 4 solved Displaying selected dropdown option … Read more

[Solved] Create a new javascript object with only selected attributes from another existing object

JSFIDDLE DEMO code: var json = { “test”: [ { “a”: “val_a1”, “b”: “val_b1”, “c”: “val_c1”, “d”: “val_d1” }, { “a”: “val_a2”, “b”: “val_b2”, “c”: “val_c2”, “d”: “val_d2” }, { “a”: “val_a3”, “b”: “val_b3”, “c”: “val_c3”, “d”: “val_d3” } ] }; var new_json = {test:{}}; $(document).ready(function(){ $.each(json.test, function(key, value){ //console.log(“key = “+key); //console.log(“value = “); … Read more

[Solved] How to highlight the respective tab on clicking an image in it [closed]

Since you are using separate event handler for each image, You can use the following script in the respective click handlers of each image $(‘.tabs li’).removeClass(‘active’).eq(1).addClass(‘active’); —————————————^ index of the tab to be displayed. Updated Fiddle 1 solved How to highlight the respective tab on clicking an image in it [closed]

[Solved] Calender is hiding , only background css is working

You didn’t added JQUERY in your fiddle Add Jquery.1.8.3 and Css Like .calendar { position: absolute; width: 430px; left: 50%; top: 50%; margin: -145px 0px 0px -140px; background: #fff; border-radius: 4px; overflow: hidden; } #datepicker div{ width:420px; } Working Demo Edit : To make date picker in german language add this code $.datepicker.setDefaults($.datepicker.regional[‘de’]); $( “#datepicker” … Read more

[Solved] moving the caption of a tooltip

Here is an updated FIDDLE. The relevant line is this one: .css(‘top’, -h.toString() + ‘px’); It positions the div for the text, and to change the position above the image, I just placed a negative sign in front of h.toString(). You could finely adjust the position by multiplying the h.toString() by a coefficient like -.8 … Read more

[Solved] To rewrite a javascript to jQuery [closed]

Easily done. Replace all document.getElementById(‘yourid’) with $(‘#yourid’) Replace all .value=”” with .val(”) Replace all .disabled = true (or false) with .prop(‘disabled’, true) // or false Replace all .checked = true (or false) with .prop(‘checked’, true) // or false and all .checked with .prop(‘checked’) solved To rewrite a javascript to jQuery [closed]

[Solved] jquery ajax submit callback get this closet [closed]

Set relevant context to done() callback, e.g using bind() and btw, prefer to use closest(): $(document).on(‘click’, ‘#file-submit’, function () { $.ajax({ url: url, type: ‘POST’, cache: false, data: formData, processData: false, contentType: false }).done(function (data, status, jqxhr) { //now ‘this’ refers to clicked element var nextId = $(this).closest(‘.tab-pane’).next().attr(“id”); alert(nextId); }.bind(this)).fail(function (data, status, jqxhr) { console.log(“error”); … Read more

[Solved] How to convert video(mp4) file into audio(mp3) file while uploading video [closed]

You can use ffmpeg to do this on all platforms. https://ffmpeg.org/ ffmpeg -i input_video.mp4 -vn output_audio.mp3 Note that this reencodes the audiostream and is therefore slower than directly extracting it with a more specific command, depending on codecs used. solved How to convert video(mp4) file into audio(mp3) file while uploading video [closed]