I am using jquery for this,
please put this code inside the function.php of your theme.
add_action('admin_head','custom_handler_for_pass_js');
if ( ! function_exists( 'custom_handler_for_pass_js' ) ) {
function custom_handler_for_pass_js()
{
?>
<script type="text/javascript">
jQuery( document ).ready(function() {
jQuery('.wp-generate-pw').click(function(){
jQuery("#pass1").keyup(function(){
if(jQuery( "#pass1" ).hasClass( "strong" )){
jQuery('#submit').prop('disabled', false);
}else{
jQuery('#submit').prop('disabled', true);
}
});
});
});
</script>
<?php
}}
This code is working, if it’s not working in your WP please check for a class name and make sure they are matching.
In case of any issue let me know.