Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <p>Testing 1 2 3</p>
  <script>
    (function() {
      function setPrefixedValue(elm, prop, value) {
        var prefixes = ['-moz-', '-webkit-', '-o-', '-ms-', '-khtml-'];
        var i, v, starting;
        
        // Clear
        elm.style[prop] = "";
        starting = elm.style[prop];
        
        // Try raw first
        try {
          elm.style[prop] = value;
          if (elm.style[prop] !== starting) {
            display("No prefix");
            return;
          }
        }
        catch (e) {
        }
        // Try prefixes
        for (i = 0; i < prefixes.length; ++i) {
          v = prefixes[i] + value;
          try {
            elm.style[prop] = v;
            if (elm.style[prop] !== starting) {
              display("Prefix: " + prefixes[i]);
              return;
            }
          }
          catch (e2) {
          }
        }
        
        display("Didn't find prefix");
      }
      
      setPrefixedValue(document.body, "background", "linear-gradient(red, blue)");
      
      function display(msg) {
        var p = document.createElement('p');
        p.innerHTML = String(msg);
        document.body.appendChild(p);
      }
    })();
  </script>
</body>
</html>
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers