What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-29 06:27:10
javascript make title blink
var isOldTitle = true; var oldTitle = "oldTitle"; var newTitle = "newTitle"; var interval = null; function changeTitle() { document.title = isOldTitle ? oldTitle : newTitle; isOldTitle = !isOldTitle; } interval = setInterval(ch... Add solution -
TypeScript 2021-10-27 19:09:09
replace all br tags within node with paragraph opening and closing tags
//My suggestion will be to split the text by <br>: var lines = content.split("<br>"); //Now you can wrap each line in a <div>: var newContent = ""; for(var i=0,l=lines.length;i<l;i++){ newContent += "&... Add solution -
Javascript 2021-10-27 01:29:08
add a slash to string in javascript
var str = 'USDYEN' // add a / in between currencies // var newStr = str.slice(0, 3) + ' / ' + str.slice(3) // var newStr = str.slice(3) // removes the first 3 chars // var newStr = str.slice(0,3) // removes the last 3 chars var newStr = str.slice(0,3) + ... Add solution -
Javascript 2021-10-25 21:37:06
convert binary to string javascript
function binaryAgent(str) { var newBin = str.split(" "); var binCode = []; for (i = 0; i < newBin.length; i++) { binCode.push(String.fromCharCode(parseInt(newBin[i], 2))); } return binCode.join(""); } binaryAgent('01000001 0... Add solution