toggle menu

Get particular HTML tag value from Full HTML script

Dhananjay Kumar |03 Oct at 11:10

Hi,

I have sloved one of my issues with using below script:

      if ((jQuery('.looping-tag-parent').length)>0) {
            //code
            displaytxt='<h4>View Content</h4><ul class="dksimmlist">';
            jQuery( ".looping-tag-parent" ).each(function() {
                var title = jQuery(this).find('p.product_title').html();
                var price = jQuery(this).find('p.product_price').html();
               
                displaytxt += '<li><span>'+title+'</span>'+price+'</li>';
                //alert(title + price);
             });
            displaytxt += '</ul>';
           
        }

 

I have get the looping tag with full html and in full html script inside "P" tag thats class name "product_title" and getting value using find() function.

Try this, its help you lots.

 

 

 

  • 0 like
  • 0 comment

Complete Solution here:

The main difference between validate() and valid()

Jquery validate() is execute on form submit with submit button while

jquery valid() is execute on click button event, this is very usefull to validate field  in modal box and validate the field without submit form 

 

add rules in jquery validate() method

 

$(document).ready(function(){

$("#formid").validate({//form id 

rules: {

emailid: {/field name

required: true,

email: true

}

}

});

});

 

add rules in jquery valid() method

$(document).ready(function(){

var form = $( "#forgotpwdfrm" );//form id 

form.validate({//define rules 

rules: {

uname: {//field name uname

required: true,

minlength: 8

},

mobile: {//field name mobile

required: true,

}

}

});

$('#forgotpwd').click(function(){//on click event

alert( "Valid: " + form.valid() );//you can write your logic here 

 

});

});

 

  • 1 like
  • 0 comment

I want to call my developed outside javascript (or jquery) function inside the google-map initialized function.

  • 0 like
  • 0 comment

Auto button click with jquery

Sanjana Kumari |26 Mar at 04:03

If you want to Jquery of javascript function with want to auto click on button, without manual press.
Simple use  $("#button_id").click(); 

Example :
function abc(){

alert("abc");

$("#button_id").click(); 

}

  • 1 like
  • 0 comment

How can get the value of JSON using jquery?

Dhananjay Kumar |20 Mar at 06:03

We have issues with the json in such formats {"7":15,"65":85}

How will i get key and value?

  • 2 likes
  • 1 comment

Dhananjay Kumar21 Mar at 10:03

I got the solution :
$.each(passtr, function(key, value) {
alert(key+"->"+value);
});