How to set title attribute
-
I am trying that when a person passes the mouse over the chat button, a message is displayed that says “Go to the Chat” thinking about accessibility. (Adding the title attribute to the button with id=wplc-chat-button)
function custom_js_for_title_button() {
?>
<script type=”text/javascript”>
jQuery(document).ready(function(){
jQuery(‘#wplc-chat-button’).attr(‘title’,’Go to Chat with Casur’);
});
</script>
<?php
}
add_action( ‘wp_footer’, ‘custom_js_for_title_button’, 5000 );I tried adding a script to wp_hook thinking that the chat was added a little later, but it doesn’t seem to work either, I guess the chat is added after absolutely all the scripts are executed.
I don’t know what to do, I need to achieve it but it doesn’t seem to be possible.
The page I need help with: [log in to see the link]
- The topic ‘How to set title attribute’ is closed to new replies.