Skip to content

Commit 59f24e8

Browse files
committed
removed language declaration from the tick code representation syntax for issue jquery#71
1 parent 96e8143 commit 59f24e8

11 files changed

+26
-26
lines changed

page/faq/how_do_I_select_elements_when_I_already_have_a_dom_element.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ source: http://docs.jquery.com/Frequently_Asked_Questions
55

66
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.
77

8-
``` js
8+
```
99
var myDomElement = document.getElementById('foo'); // a plain DOM element
1010
$(myDomElement).find('a'); // finds all anchors inside the DOM element
1111
```
1212

1313
Many people try to concatenate a DOM element or jQuery object with a CSS selector, like so:
1414

15-
``` js
15+
```
1616
$(myDomElement + '.bar'); // This is equivalent to $("[object HTMLElement].bar")
1717
```
1818

page/faq/how_do_i_check_uncheck_a_checkbox_input_or_radio_button.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ There are two ways to check/uncheck a checkbox/radio button.
77

88
Set the 'checked' attribute to true or false.
99

10-
``` js
10+
```
1111
// Check #x
1212
$('#x').attr('checked', true);
1313
// Uncheck #x
@@ -16,7 +16,7 @@ Set the 'checked' attribute to true or false.
1616

1717
Add or remove the 'checked' attribute:
1818

19-
``` js
19+
```
2020
// Check #x
2121
$("#x").attr('checked', 'checked');
2222
// Uncheck #x

page/faq/how_do_i_determine_the_state_of_a_toggled_element.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ source: http://docs.jquery.com/Frequently_Asked_Questions
55

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

8-
``` js
8+
```
99
var isVisible = $('#myDiv').is(':visible');
1010
var isHidden = $('#myDiv').is(':hidden');
1111
```
1212

1313
If you're simply acting on an element based on its visibility, just include ":visible" or ":hidden" in the selector expression. For example:
1414

15-
``` js
15+
```
1616
$('#myDiv:visible').animate({left: '+=200px'}, 'slow');
1717
```

page/faq/how_do_i_disable_enable_a_form_element.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ There are two ways to disable/enable form elements.
77

88
Set the 'disabled' attribute to true or false:
99

10-
``` js
10+
```
1111
// Disable #x
1212
$('#x').attr('disabled', true);
1313
// Enable #x
@@ -16,7 +16,7 @@ Set the 'disabled' attribute to true or false:
1616

1717
Add or remove the 'disabled' attribute:
1818

19-
``` js
19+
```
2020
// Disable #x
2121
$("#x").attr('disabled', 'disabled');
2222
// Enable #x

page/faq/how_do_i_get_the_text_value_of_a_selected_option.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ source: http://docs.jquery.com/Frequently_Asked_Questions
55

66
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:
77

8-
``` js
8+
```
99
$("#myselect").val();
1010
// => 1
1111
```
1212

1313
The second is the text value of the select. For example, using the following select box:
1414

15-
``` html
15+
```
1616
<select id="myselect">
1717
<option value="1">Mr</option>
1818
<option value="2">Mrs</option>
@@ -24,7 +24,7 @@ The second is the text value of the select. For example, using the following sel
2424

2525
If you wanted to get the string "Mr" if the first option was selected (instead of just "1"), you would do that in the following way:
2626

27-
``` js
27+
```
2828
$("#myselect option:selected").text();
2929
// => "Mr"
3030
```

page/faq/how_do_i_pull_a_native_dom_element_from_a_jquery_object.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ source: http://docs.jquery.com/Frequently_Asked_Questions
55

66
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:
77

8-
``` js
8+
```
99
$('#foo')[0]; // equivalent to document.getElementById('foo')
1010
```
1111

1212
The second method is to use the [get](http://api.jquery.com/get/) function:
1313

14-
``` js
14+
```
1515
$('#foo').get(0); // identical to above, only slower
1616
```
1717

page/faq/how_do_i_replace_text_from_the_3rd_element_of_a_list_of_10_items.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ source: http://docs.jquery.com/Frequently_Asked_Questions
55

66
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:
77

8-
``` js
8+
```
99
// This doesn't work; text() returns a string, not the jQuery object
1010
$(this).find('li a').eq(2).text().replace('foo','bar');
1111

page/faq/how_do_i_select_an_element_by_an_id_that_has_characters_used_in_css_notation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Because jQuery uses CSS syntax for selecting elements, some characters are inter
77

88
In order to tell jQuery to treat these characters literally rather than as CSS notation, they must be "escaped" by placing two backslashes in front of them.
99

10-
``` js
10+
```
1111
// Does not work
1212
$("#some:id")
1313
@@ -22,14 +22,14 @@ In order to tell jQuery to treat these characters literally rather than as CSS n
2222

2323
The following function takes care of escaping these characters and places a "#" at the beginning of the ID string:
2424

25-
``` js
25+
```
2626
function jq(myid) {
2727
return '#' + myid.replace(/(:|\.)/g,'\\$1');
2828
}
2929
```
3030

3131
The function can be used like so:
3232

33-
``` js
33+
```
3434
$( jq('some.id') )
3535
```

page/faq/how_do_i_select_an_item_using_class_or_id.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@ source: http://docs.jquery.com/Frequently_Asked_Questions
55

66
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.
77

8-
``` js
8+
```
99
$('#myDivId')
1010
```
1111

1212
This code selects an element with a class of "myCssClass". Since any number of elements can have the same class, this expression will select any number of elements.
1313

14-
``` js
14+
```
1515
$('.myCssClass')
1616
```
1717

1818
A jQuery object containing the selected element can be assigned to a JavaScript variable like normal:
1919

20-
``` js
20+
```
2121
var myDivElement = $('#myDivId');
2222
```
2323

2424
Usually, elements in a jQuery object are acted on by other jQuery functions:
2525

26-
``` js
26+
```
2727
var myValue = $('#myDivId').val(); // get the value of a form input
2828
2929
$('#myDivId').val("hello world"); // set the value of a form input

page/faq/how_do_i_test_whether_an_element_exists.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ source: http://docs.jquery.com/Frequently_Asked_Questions
55

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

8-
``` js
8+
```
99
if ( $('#myDiv').length )
1010
$('#myDiv').show();
1111
```
1212

1313
Note that it isn't always necessary to test whether an element exists. The following code will show the element if it exists, and do nothing (with no errors) if it does not:
1414

15-
``` js
15+
```
1616
$('#myDiv').show();
1717
```

page/faq/how_do_i_test_whether_an_element_has_a_particular_class.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ source: http://docs.jquery.com/Frequently_Asked_Questions
55

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

8-
``` js
8+
```
99
$("div").click(function(){
1010
if ( $(this).hasClass("protected") )
1111
$(this)
@@ -19,14 +19,14 @@ $("div").click(function(){
1919

2020
You can also use the [is()](http://api.jquery.com/is/) method along with an appropriate selector for more advanced matching:
2121

22-
``` js
22+
```
2323
if ( $('#myDiv').is('.pretty.awesome') )
2424
$('#myDiv').show();
2525
```
2626

2727
Note that this method allows you to test for other things as well. For example, you can test whether an element is hidden (by using the custom [:hidden](http://api.jquery.com/hidden-selector/) selector):
2828

29-
``` js
29+
```
3030
if ( $('#myDiv').is(':hidden') )
3131
$('#myDiv').show();
3232
```

0 commit comments

Comments
 (0)