-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
68 lines (43 loc) · 1.97 KB
/
index.md
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
title: String.prototype.big()
slug: Web/JavaScript/Reference/Global_Objects/String/big
page-type: javascript-instance-method
status:
- deprecated
browser-compat: javascript.builtins.String.big
---
{{JSRef}} {{Deprecated_Header}}
The **`big()`** method of {{jsxref("String")}} values creates a string that embeds this string in a {{HTMLElement("big")}} element (`<big>str</big>`), which causes this string to be displayed in a big font.
> **Note:** All [HTML wrapper methods](/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#html_wrapper_methods) are deprecated and only standardized for compatibility purposes. For the case of `big()`, the `<big>` element itself has been removed from the HTML specification and shouldn't be used anymore. Web developers should use [CSS](/en-US/docs/Web/CSS) properties instead.
## Syntax
```js-nolint
big()
```
### Parameters
None.
### Return value
A string beginning with a `<big>` start tag, then the text `str`, and then a `</big>` end tag.
## Examples
### Using big()
The code below creates an HTML string and then replaces the document's body with it:
```js
const contentString = "Hello, world";
document.body.innerHTML = contentString.big();
```
This will create the following HTML:
```html
<big>Hello, world</big>
```
> **Warning:** This markup is invalid, because `big` is no longer a valid element.
Instead of using `big()` and creating HTML text directly, you should use CSS to manipulate fonts. For example, you can manipulate {{cssxref("font-size")}} through the {{domxref("HTMLElement/style", "element.style")}} attribute:
```js
document.getElementById("yourElemId").style.fontSize = "2em";
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [Polyfill of `String.prototype.big` in `core-js`](https://github.com/zloirock/core-js#ecmascript-string-and-regexp)
- [HTML wrapper methods](/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#html_wrapper_methods)
- {{HTMLElement("big")}}