Thẻ html nào đúng để viết mã javascript?

Phần tử HTML

đại diện cho một đoạn văn. Các đoạn thường được trình bày trong phương tiện trực quan dưới dạng các khối văn bản được phân tách khỏi các khối liền kề bằng các dòng trống và/hoặc thụt đầu dòng ở dòng đầu tiên, nhưng các đoạn HTML có thể là bất kỳ nhóm cấu trúc nào của nội dung liên quan, chẳng hạn như hình ảnh hoặc trường biểu mẫu

Các đoạn văn là các phần tử cấp khối và đáng chú ý là sẽ tự động đóng nếu một phần tử cấp khối khác được phân tích cú pháp trước thẻ đóng

. Xem phần "Thiếu thẻ" bên dưới

Danh mục nội dung, nội dung sờ thấy. nội dung được phép. Bỏ qua thẻThẻ bắt đầu là bắt buộc. Thẻ kết thúc có thể bị bỏ qua nếu phần tử

được theo ngay sau bởi một

,
,
<p>Separating paragraphs with blank lines is easiest
for readers to scan, but they can also be separated
by indenting their first lines. This is often used
to take up less space, such as to save paper in print.p>

<p>Writing that is intended to be edited, such as school
papers and rough drafts, uses both blank lines and
indentation for separation. In finished works, combining
both is considered redundant and amateurish.p>

<p>In very old writing, paragraphs were separated with a
special character: ¶, the <i>pilcrowi>. Nowadays, this
is considered claustrophobic and hard to read.p>

<p>How hard to read? See for yourself:
  <button data-toggle-text="Oh no! Switch back!">Use pilcrow for paragraphsbutton>
p>
0,
<p>Separating paragraphs with blank lines is easiest
for readers to scan, but they can also be separated
by indenting their first lines. This is often used
to take up less space, such as to save paper in print.p>

<p>Writing that is intended to be edited, such as school
papers and rough drafts, uses both blank lines and
indentation for separation. In finished works, combining
both is considered redundant and amateurish.p>

<p>In very old writing, paragraphs were separated with a
special character: ¶, the <i>pilcrowi>. Nowadays, this
is considered claustrophobic and hard to read.p>

<p>How hard to read? See for yourself:
  <button data-toggle-text="Oh no! Switch back!">Use pilcrow for paragraphsbutton>
p>
1,
<p>Separating paragraphs with blank lines is easiest
for readers to scan, but they can also be separated
by indenting their first lines. This is often used
to take up less space, such as to save paper in print.p>

<p>Writing that is intended to be edited, such as school
papers and rough drafts, uses both blank lines and
indentation for separation. In finished works, combining
both is considered redundant and amateurish.p>

<p>In very old writing, paragraphs were separated with a
special character: ¶, the <i>pilcrowi>. Nowadays, this
is considered claustrophobic and hard to read.p>

<p>How hard to read? See for yourself:
  <button data-toggle-text="Oh no! Switch back!">Use pilcrow for paragraphsbutton>
p>
2,
<p>Separating paragraphs with blank lines is easiest
for readers to scan, but they can also be separated
by indenting their first lines. This is often used
to take up less space, such as to save paper in print.p>

<p>Writing that is intended to be edited, such as school
papers and rough drafts, uses both blank lines and
indentation for separation. In finished works, combining
both is considered redundant and amateurish.p>

<p>In very old writing, paragraphs were separated with a
special character: ¶, the <i>pilcrowi>. Nowadays, this
is considered claustrophobic and hard to read.p>

<p>How hard to read? See for yourself:
  <button data-toggle-text="Oh no! Switch back!">Use pilcrow for paragraphsbutton>
p>
3,
<p>Separating paragraphs with blank lines is easiest
for readers to scan, but they can also be separated
by indenting their first lines. This is often used
to take up less space, such as to save paper in print.p>

<p>Writing that is intended to be edited, such as school
papers and rough drafts, uses both blank lines and
indentation for separation. In finished works, combining
both is considered redundant and amateurish.p>

<p>In very old writing, paragraphs were separated with a
special character: ¶, the <i>pilcrowi>. Nowadays, this
is considered claustrophobic and hard to read.p>

<p>How hard to read? See for yourself:
  <button data-toggle-text="Oh no! Switch back!">Use pilcrow for paragraphsbutton>
p>
4,
<p>Separating paragraphs with blank lines is easiest
for readers to scan, but they can also be separated
by indenting their first lines. This is often used
to take up less space, such as to save paper in print.p>

<p>Writing that is intended to be edited, such as school
papers and rough drafts, uses both blank lines and
indentation for separation. In finished works, combining
both is considered redundant and amateurish.p>

<p>In very old writing, paragraphs were separated with a
special character: ¶, the <i>pilcrowi>. Nowadays, this
is considered claustrophobic and hard to read.p>

<p>How hard to read? See for yourself:
  <button data-toggle-text="Oh no! Switch back!">Use pilcrow for paragraphsbutton>
p>
5,
<p>Separating paragraphs with blank lines is easiest
for readers to scan, but they can also be separated
by indenting their first lines. This is often used
to take up less space, such as to save paper in print.p>

<p>Writing that is intended to be edited, such as school
papers and rough drafts, uses both blank lines and
indentation for separation. In finished works, combining
both is considered redundant and amateurish.p>

<p>In very old writing, paragraphs were separated with a
special character: ¶, the <i>pilcrowi>. Nowadays, this
is considered claustrophobic and hard to read.p>

<p>How hard to read? See for yourself:
  <button data-toggle-text="Oh no! Switch back!">Use pilcrow for paragraphsbutton>
p>
6,
<p>Separating paragraphs with blank lines is easiest
for readers to scan, but they can also be separated
by indenting their first lines. This is often used
to take up less space, such as to save paper in print.p>

<p>Writing that is intended to be edited, such as school
papers and rough drafts, uses both blank lines and
indentation for separation. In finished works, combining
both is considered redundant and amateurish.p>

<p>In very old writing, paragraphs were separated with a
special character: ¶, the <i>pilcrowi>. Nowadays, this
is considered claustrophobic and hard to read.p>

<p>How hard to read? See for yourself:
  <button data-toggle-text="Oh no! Switch back!">Use pilcrow for paragraphsbutton>
p>
7,
<p>Separating paragraphs with blank lines is easiest
for readers to scan, but they can also be separated
by indenting their first lines. This is often used
to take up less space, such as to save paper in print.p>

<p>Writing that is intended to be edited, such as school
papers and rough drafts, uses both blank lines and
indentation for separation. In finished works, combining
both is considered redundant and amateurish.p>

<p>In very old writing, paragraphs were separated with a
special character: ¶, the <i>pilcrowi>. Nowadays, this
is considered claustrophobic and hard to read.p>

<p>How hard to read? See for yourself:
  <button data-toggle-text="Oh no! Switch back!">Use pilcrow for paragraphsbutton>
p>
8,
<p>Separating paragraphs with blank lines is easiest
for readers to scan, but they can also be separated
by indenting their first lines. This is often used
to take up less space, such as to save paper in print.p>

<p>Writing that is intended to be edited, such as school
papers and rough drafts, uses both blank lines and
indentation for separation. In finished works, combining
both is considered redundant and amateurish.p>

<p>In very old writing, paragraphs were separated with a
special character: ¶, the <i>pilcrowi>. Nowadays, this
is considered claustrophobic and hard to read.p>

<p>How hard to read? See for yourself:
  <button data-toggle-text="Oh no! Switch back!">Use pilcrow for paragraphsbutton>
p>
9,
p {
  margin: 0;
  text-indent: 3ch;
}

p.pilcrow {
  text-indent: 0;
  display: inline;
}
p.pilcrow + p.pilcrow::before {
  content: " ¶ ";
}
0,
p {
  margin: 0;
  text-indent: 3ch;
}

p.pilcrow {
  text-indent: 0;
  display: inline;
}
p.pilcrow + p.pilcrow::before {
  content: " ¶ ";
}
1,
p {
  margin: 0;
  text-indent: 3ch;
}

p.pilcrow {
  text-indent: 0;
  display: inline;
}
p.pilcrow + p.pilcrow::before {
  content: " ¶ ";
}
2,
p {
  margin: 0;
  text-indent: 3ch;
}

p.pilcrow {
  text-indent: 0;
  display: inline;
}
p.pilcrow + p.pilcrow::before {
  content: " ¶ ";
}
3,
p {
  margin: 0;
  text-indent: 3ch;
}

p.pilcrow {
  text-indent: 0;
  display: inline;
}
p.pilcrow + p.pilcrow::before {
  content: " ¶ ";
}
3,
p {
  margin: 0;
  text-indent: 3ch;
}

p.pilcrow {
  text-indent: 0;
  display: inline;
}
p.pilcrow + p.pilcrow::before {
  content: " ¶ ";
}
4,
p {
  margin: 0;
  text-indent: 3ch;
}

p.pilcrow {
  text-indent: 0;
  display: inline;
}
p.pilcrow + p.pilcrow::before {
  content: " ¶ ";
}
3,
p {
  margin: 0;
  text-indent: 3ch;
}

p.pilcrow {
  text-indent: 0;
  display: inline;
}
p.pilcrow + p.pilcrow::before {
  content: " ¶ ";
}
. Cha mẹ được phép Bất kỳ phần tử nào chấp nhận. Vai trò ARIA ngầm định Vai trò ARIA được phép Giao diện AnyDOM_______20_______4

Phần tử này chỉ bao gồm các thuộc tính toàn cầu

Ghi chú. Thuộc tính

document.querySelector('button').addEventListener('click', (event) => {
  document.querySelectorAll('p').forEach((paragraph) => {
    paragraph.classList.toggle('pilcrow');
  });

  [event.target.innerText, event.target.dataset.toggleText] =
    [event.target.dataset.toggleText, event.target.innerText];
});
5 trên thẻ

đã lỗi thời và không nên sử dụng

<p>
  This is the first paragraph of text. This is the first paragraph of text. This
  is the first paragraph of text. This is the first paragraph of text.
p>
<p>
  This is the second paragraph. This is the second paragraph. This is the second
  paragraph. This is the second paragraph.
p>

Theo mặc định, các trình duyệt phân tách các đoạn bằng một dòng trống. Có thể đạt được các phương pháp phân tách thay thế, chẳng hạn như thụt lề dòng đầu tiên bằng CSS

<p>Separating paragraphs with blank lines is easiest
for readers to scan, but they can also be separated
by indenting their first lines. This is often used
to take up less space, such as to save paper in print.p>

<p>Writing that is intended to be edited, such as school
papers and rough drafts, uses both blank lines and
indentation for separation. In finished works, combining
both is considered redundant and amateurish.p>

<p>In very old writing, paragraphs were separated with a
special character: ¶, the <i>pilcrowi>. Nowadays, this
is considered claustrophobic and hard to read.p>

<p>How hard to read? See for yourself:
  <button data-toggle-text="Oh no! Switch back!">Use pilcrow for paragraphsbutton>
p>

p {
  margin: 0;
  text-indent: 3ch;
}

p.pilcrow {
  text-indent: 0;
  display: inline;
}
p.pilcrow + p.pilcrow::before {
  content: " ¶ ";
}

document.querySelector('button').addEventListener('click', (event) => {
  document.querySelectorAll('p').forEach((paragraph) => {
    paragraph.classList.toggle('pilcrow');
  });

  [event.target.innerText, event.target.dataset.toggleText] =
    [event.target.dataset.toggleText, event.target.innerText];
});

Chia nhỏ nội dung thành các đoạn giúp làm cho trang dễ truy cập hơn. Trình đọc màn hình và công nghệ hỗ trợ khác cung cấp lối tắt để cho phép người dùng chuyển sang đoạn tiếp theo hoặc đoạn trước đó, cho phép họ đọc lướt qua nội dung như cách khoảng trắng cho phép người dùng trực quan bỏ qua

Sử dụng các phần tử ________ 29 ______ trống để thêm khoảng cách giữa các đoạn văn là một vấn đề đối với những người điều hướng bằng công nghệ đọc màn hình. Trình đọc màn hình có thể thông báo sự hiện diện của đoạn văn, nhưng không phải bất kỳ nội dung nào chứa trong đó — bởi vì không có. Điều này có thể khiến người sử dụng trình đọc màn hình bối rối và khó chịu

Thẻ HTML chính xác để viết JavaScript là gì?

Thẻ HTML