-
Style your website with bluePen
it's an online visual CSS editor!
bluePen Editor is an Online Visual CSS editor built for you.
It's a web application that allows you to edit your existing
stylesheets on your website.
This is done by the "What You See Is What You Get" principle
so you don't need any special skills.
Don't fear to make any mistakes
because bluePen Editor has a
built in safety system.
Get to know bluePen here or
on your own website and
go pro today!
Make the first step and Try out here
.html()Returns: String
Description: Get the HTML contents of the first element in the set of matched elements.
This method is not available on XML documents.
In an HTML document,
In order for the following
The result would look like this:
This method uses the browser's
In an HTML document,
.html()
can be used to get
the contents of any element. If the selector expression matches more
than one element, only the first match will have its HTML content
returned. Consider this code:
1
|
|
<div>
's content to be retrieved, it would have to be the first one with class="demo-container"
in the document:
1
2
3
|
|
1
|
|
innerHTML
property.
Some browsers may not return HTML that exactly replicates the HTML
source in an original document. For example, Internet Explorer sometimes
leaves off the quotes around attribute values if they contain only
alphanumeric characters.Additional Notes:
-
By design, any jQuery constructor or method that accepts an HTML string — jQuery(), .append(), .after(),
etc. — can potentially execute code. This can occur by injection of
script tags or use of HTML attributes that execute code (for example,
<img onload="">
). Do not use these methods to insert strings obtained from untrusted sources such as URL query parameters, cookies, or form inputs. Doing so can introduce cross-site-scripting (XSS) vulnerabilities. Remove or escape any user input before adding content to the document.
Example:
Click a paragraph to convert it from html to text.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
|