Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <script src="https://code.jquery.com/jquery-3.1.0.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <pre id="console"></pre>
</body>
</html>
 
// My code
function log() {
    var p = document.createElement("p"),
        text = Array.prototype.join.call(arguments, ", ");
    p.textContent = text;
    document.getElementById("console").appendChild(p);
    return text;
}
$("body").data("abc", "12");
log("data abc : "+$("body").data("abc"));
log("data abc : "+$("body").attr("data-abc"));
log("data abc : "+$("body").attr("abc"));
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers