Skip to content

Instantly share code, notes, and snippets.

@Dosant
Created March 6, 2017 18:12
Show Gist options
  • Save Dosant/e58b4a29db8692dfdfe9d9f9edc93eff to your computer and use it in GitHub Desktop.
Save Dosant/e58b4a29db8692dfdfe9d9f9edc93eff to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<div id="div-1">
</div>
<div id="div-2">
</div>
<script>
var div1 = document.getElementById('div-1');
var div2 = document.getElementById('div-2');
div1.innerHTML = '<strong>Text</strong>' // Запишет Text
div2.textContent = '<strong>Text</strong>' // Запишет <strong>Text</strong
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment