Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE HTML>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<meta charset=utf-8 />
</head>
  
<body>
  
<div id="txtFirstname"></div>
  
</body>
</html>
 
jQuery(function($){
    $('#txtFirstname').addClass('test[someval]');
    console.log( $('#txtFirstname').attr('class') );
    console.log( $('#txtFirstname').hasClass('test[someval]') );
});
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers