Skip to content

Commit 7646173

Browse files
arthurvragcolom
authored andcommitted
FAQ: Don't reference docs.jquery.com as source
Fixes gh-570 Closes gh-579
1 parent 8be9405 commit 7646173

11 files changed

+11
-22
lines changed

page/using-jquery-core/faq/how-do-i-check-uncheck-a-checkbox-input-or-radio-button.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script>{
2-
"title": "How do I check/uncheck a checkbox input or radio button?",
3-
"source": "http://docs.jquery.com/Frequently_Asked_Questions"
2+
"title": "How do I check/uncheck a checkbox input or radio button?"
43
}</script>
54

65
You can check or uncheck a checkbox element or a radio button using the `.prop()` method:

page/using-jquery-core/faq/how-do-i-determine-the-state-of-a-toggled-element.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script>{
2-
"title": "How do I determine the state of a toggled element?",
3-
"source": "http://docs.jquery.com/Frequently_Asked_Questions"
2+
"title": "How do I determine the state of a toggled element?"
43
}</script>
54

65
You can determine whether an element is collapsed or not by using the `:visible` and `:hidden` selectors.

page/using-jquery-core/faq/how-do-i-disable-enable-a-form-element.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script>{
2-
"title": "How do I disable/enable a form element?",
3-
"source": "http://docs.jquery.com/Frequently_Asked_Questions"
2+
"title": "How do I disable/enable a form element?"
43
}</script>
54

65
You can enable or disable a form element using the `.prop()` method:

page/using-jquery-core/faq/how-do-i-get-the-text-value-of-a-selected-option.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script>{
2-
"title": "How do I get the text value of a selected option?",
3-
"source": "http://docs.jquery.com/Frequently_Asked_Questions"
2+
"title": "How do I get the text value of a selected option?"
43
}</script>
54

65
Select elements typically have two values that you want to access. First there's the value to be sent to the server, which is easy:

page/using-jquery-core/faq/how-do-i-pull-a-native-dom-element-from-a-jquery-object.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script>{
2-
"title": "How do I pull a native DOM element from a jQuery object?",
3-
"source": "http://docs.jquery.com/Frequently_Asked_Questions"
2+
"title": "How do I pull a native DOM element from a jQuery object?"
43
}</script>
54

65
A jQuery object is an array-like wrapper around one or more DOM elements. To get a reference to the actual DOM elements (instead of the jQuery object), you have two options. The first (and fastest) method is to use array notation:

page/using-jquery-core/faq/how-do-i-replace-text-from-the-3rd-element-of-a-list-of-10-items.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script>{
2-
"title": "How do I replace text from the 3rd element of a list of 10 items?",
3-
"source": "http://docs.jquery.com/Frequently_Asked_Questions"
2+
"title": "How do I replace text from the 3rd element of a list of 10 items?"
43
}</script>
54

65
Either the `:eq()` selector or the `.eq()` method will allow you to select the proper item. However, to replace the text, you must get the value before you set it:

page/using-jquery-core/faq/how-do-i-select-an-element-by-an-id-that-has-characters-used-in-css-notation.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script>{
2-
"title": "How do I select an element by an ID that has characters used in CSS notation?",
3-
"source": "http://docs.jquery.com/Frequently_Asked_Questions"
2+
"title": "How do I select an element by an ID that has characters used in CSS notation?"
43
}</script>
54

65
Because jQuery uses CSS syntax for selecting elements, some characters are interpreted as CSS notation. For example, ID attributes, after an initial letter (a-z or A-Z), may also use periods and colons, in addition to letters, numbers, hyphens, and underscores (see [W3C Basic HTML Data Types](http://www.w3.org/TR/html4/types.html#type-id)). The colon (":") and period (".") are problematic within the context of a jQuery selector because they indicate a pseudo-class and class, respectively.

page/using-jquery-core/faq/how-do-i-select-an-item-using-class-or-id.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script>{
2-
"title": "How do I select an item using class or ID?",
3-
"source": "http://docs.jquery.com/Frequently_Asked_Questions"
2+
"title": "How do I select an item using class or ID?"
43
}</script>
54

65
This code selects an element with an ID of "myDivId". Since IDs are unique, this expression always selects either zero or one elements depending upon whether or not an element with the specified ID exists.

page/using-jquery-core/faq/how-do-i-select-elements-when-i-already-have-a-dom-element.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script>{
2-
"title": "How do I select elements when I already have a DOM element?",
3-
"source": "http://docs.jquery.com/Frequently_Asked_Questions"
2+
"title": "How do I select elements when I already have a DOM element?"
43
}</script>
54

65
If you have a variable containing a DOM element, and want to select elements related to that DOM element, simply wrap it in a jQuery object.

page/using-jquery-core/faq/how-do-i-test-whether-an-element-exists.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script>{
2-
"title": "How do I test whether an element exists?",
3-
"source": "http://docs.jquery.com/Frequently_Asked_Questions"
2+
"title": "How do I test whether an element exists?"
43
}</script>
54

65
Use the [.length](http://api.jquery.com/length/) property of the jQuery collection returned by your selector:

page/using-jquery-core/faq/how-do-i-test-whether-an-element-has-a-particular-class.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script>{
2-
"title": "How do I test whether an element has a particular class?",
3-
"source": "http://docs.jquery.com/Frequently_Asked_Questions"
2+
"title": "How do I test whether an element has a particular class?"
43
}</script>
54

65
[.hasClass()](http://api.jquery.com/hasClass/) (added in version 1.2) handles this common use case:

0 commit comments

Comments
 (0)