Use this in the page footer (after the element to be changed)

<script>
  document.getElementById( 'user-xprofile' ).onclick = function() { MyFunction(); };
</script>

Change the html content and add an on click submit form to a span

<script>
  document.getElementById( 'ajax_value1' ).innerHTML = 'Click here...';
  document.getElementById( 'ajax_value1' ).onclick = function(){document.getElementById( 'my_form_id' ).submit();};
</script>