[jQuery] Call function only on matched elements

2009-04-20 Thread xiaohouzi79
I have two input fields "#HTML" and "#javascript" and a "#results" div field. Once the submit button is pressed I want the contents of #HTML to appear in #results and any javascript functionality in #javascript to be applied ONLY to the the contents of the #results div. I know how to get the cont

[jQuery] Free jQuery select elements cheat sheet

2009-03-24 Thread xiaohouzi79
I've just finished writing a jQuery cheat sheet which is available for free download in pdf format. I've have put hours of work in to gathering together information from different tutorials and other sources to write this document. It is organized around the jQuery API for easy reference. You c

[jQuery] Re: using a variable within .css()

2009-01-05 Thread xiaohouzi79
Hi Chris, It looks like you are placing the variable inside '' I think you are wanting to concatenate the value of the variable as such: var color1 = '255'; alert('My color is: ' + color1); // My color is: 255 The problem is it seems like you are doing it this way: var color1 = '255'; alert(

[jQuery] After refresh $(document).ready shows different value for select from change

2008-11-28 Thread xiaohouzi79
The following two are giving different results: $("#service_select").change(function() { alert($("#service_select").val()); } $(document).ready(function() { if ($("#service_select option:selected")) { alert($("#service_select").val()); } } Onchange I get the option value. On doc