Hi, I need some help to write display values in a variable from a page using jQuery, also how to write the functions for that.. Var1 - I need to display the name which we are selecting in drop down (on change) Var2- I need to pull “product id” of product page (onload/click) Var3- needs to display “product id” value in var3 if form submitted successfully (successful submit). Can someone please help me on this to write syntax on this. Thanks in Advance
I don't mind helping out when someone has at least had a go at writing the code themselves. Have a go at writing the code and if you get stuck I'm sure everyone will help you out. Have a read of these pages: Var1 = http://api.jquery.com/change/ Var2 = http://api.jquery.com/click/ Var3 = http://api.jquery.com/val/ & http://api.jquery.com/text/ & http://api.jquery.com/jquery.ajax/
Hi I just wanted to know how to pull a value in var var1 = jQuery("Here what i need to use class? or id?").this() , if use class what syntax should i use or if use id?
Also take note that getting the content might differ slightly depending on what you're trying to do. It might be $('.class-name').text(); or it might be $('.class-name').val(); or the same for ID: $('#id-name').text(); or $('#id-name').val(); Also take note that if you do this for instance on a click-function, you need to specifically target the clicked item if using a class (or else you'll get all the content from all the items matching that class). Something like: $('.class-name').click(function() { $(this).val(); })