-
Notifications
You must be signed in to change notification settings - Fork 0
/
Basics.js
41 lines (33 loc) · 1.19 KB
/
Basics.js
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
//Italics
function Italics() {
let input4 = document.getElementById('input4').value;
let italicize = input4.italics();
document.getElementById('output4').innerHTML = italicize;
};
//Bold
//'<b>' <---- May have to use for browser compatibility since bold() is deprecated but I'm chillin.
//'<b>' + '' + '</b>'; update: it worked for now; leaving it
function bold() {
let input5 = document.getElementById('input5').value;
let bolded = input5.bold();
document.getElementById('output5').innerHTML = bolded;
};
//Strikethrough
function Strike() {
let input6 = document.getElementById('input6').value;
let strikeout = input6.strike();
document.getElementById('output6').innerHTML = strikeout;
};
//Underline
// Couldn't get toUnderline() to work possibly due to the compatibility issues so used classic ol' HTML.
function toUnderline() {
let input7 = document.getElementById('input7').value;
let output7 = document.getElementById('output7');
output7.innerHTML = '<u>' + input7 + '</u>';
};
//Superscript
function Superscript() {
let input8 = document.getElementById('input8').value;
let output8 = document.getElementById('output8');
output8.innerHTML = '<sup>' + input8 + '</sup>';
};