How to automatically select a textbox when a web page loads?

<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>

<body onload="ss()">


<script>
$(function myfuntion() {
  $("#amit").focus();
});
</script>


<input type="text" id="amit">

</body>

How can you hide or change the parent div having some specific content?

<script>
$(document).ready(function () {
    $("a:contains('ordinary text')").parent('.classname').hide();
});
</script>

or

<script>
$(document).ready(function() {
  if( $('label:contains("Size")').length) {
    $('span.amount').hide();  
    $('.price').hide();
  }
});
</script>

How can we change the class or div content by giving it a specific condition?

<script>

$(document).ready(function() {

  if( $("button:contains('Add to cart')").length) {
     
    $('.classname').css('display', 'none');
   
  }
});

</script>

How to change placeholder with javascript?

<script type="text/javascript">

$(document).ready(function(){

$('#divname').attr('placeholder','Enter Placeholder here');

});

</script>

How to print date in wordpress woocommerce ?

<?php printf( __( 'Date %s', 'woocommerce'), $order->get_order_number() ); ?> (<?php printf( '<time datetime="%s">%s</time>', date_i18n( 'c', strtotime( $order->order_date ) ), date_i18n( woocommerce_date_format(), strtotime( $order->order_date ) ) ); ?>

How to get user role in wordpress or how to work with the user role condition in wordpress?

<?php
global $current_user;
get_currentuserinfo();
$myuser= "$current_user->ID";
$user_roles = $current_user->roles;
$user_role = array_shift($user_roles);
?>


<?php
if ($user_role == 'contributor') {
?>

// your code is here //

<?php
}
?>