Skip to content

Made text reflect code. Set "rel" to valid value. #495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions page/using-jquery-core/manipulating-elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ $( "<a/>", {
});
```

Note that the attributes object in the second argument above, the property name class is quoted, although the property names `text` and `href` are not. Property names generally do not need to be quoted unless they are [reserved words](/javascript-101/reserved-words/) (as `class` is in this case).
Note that the attributes object in the second argument above, the property name class is quoted, although the property names `html` and `href` are not. Property names generally do not need to be quoted unless they are [reserved words](/javascript-101/reserved-words/) (as `class` is in this case).

When you create a new element, it is not immediately added to the page. There are several ways to add an element to the page once it's been created.

Expand Down Expand Up @@ -144,14 +144,14 @@ $( "#myDiv a:first" ).attr( "href", "newDestination.html" );
// Manipulating multiple attributes.
$( "#myDiv a:first" ).attr({
href: "newDestination.html",
rel: "super-special"
rel: "nofollow"
});
```

```
// Using a function to determine an attribute's new value.
$( "#myDiv a:first" ).attr({
rel: "super-special",
rel: "nofollow",
href: function( idx, href ) {
return "/new/" + href;
}
Expand Down