Skip to content

Instantly share code, notes, and snippets.

@rambhairao
Last active July 19, 2017 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rambhairao/2f5cf79e175a6915b01b39765e7546c7 to your computer and use it in GitHub Desktop.
Save rambhairao/2f5cf79e175a6915b01b39765e7546c7 to your computer and use it in GitHub Desktop.
JS Bin// source https://jsbin.com/qumoqim
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
p{
text-transform: uppercase;
cursor: pointer;
}
</style>
</head>
<body>
<p> PLAYER-1: </p>
<script id="jsbin-javascript">
var nem = document.querySelector('p');
nem.addEventListener('click', addfunction);
function addfunction(){
var nm = prompt("Enter name :");
nem.textContent = 'PLAYER-1:' +nm;
}
</script>
<script id="jsbin-source-css" type="text/css">p{
text-transform: uppercase;
cursor: pointer;
}</script>
<script id="jsbin-source-javascript" type="text/javascript">var nem = document.querySelector('p');
nem.addEventListener('click', addfunction);
function addfunction(){
var nm = prompt("Enter name :");
nem.textContent = 'PLAYER-1:' +nm;
}
</script></body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment