Convert from jQuery to JavaScript

Could somebody please help me to convert this code from jQuery to JavaScript please?

<script src=""></script>
    $(function () {
    //hover event for button
    $("#tw-img").hover(function () {

        //remove picture

        //run social code
        !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);;js.src=p+'://';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');

<img id="tw-img" src="" style="width:200px;height:auto">
<a href="" class="twitter-share-button"></a>

Hi there letsforum,

does this help…


untitled document #tw-img { width:200px; } .hide { display:none; }



1 Like


I think that if you’re asking for help you should at least show your attempt in performing the task, don’t you think? Otherwise it might seem that you’re simply asking other people to do your work :slight_smile:

1 Like

jQuery is JavaScript so that code already is JavaScript provided that you include the extra javaScript from the jQuery file.

Thanks buddy very much your are awesome works great :wink:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.