Convert from jQuery to JavaScript

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

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>
    $(function () {
    //hover event for button
    $("#tw-img").hover(function () {

        //remove picture
        $(this).remove()

        //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.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');
    })
});
</script>

<img id="tw-img" src="http://www.southernfriedscience.com/wp-content/uploads/2011/12/logo_twitter_withbird_1000_allblue.png" style="width:200px;height:auto">
<a href="https://twitter.com/share" class="twitter-share-button"></a>

Hi there letsforum,

does this help…

[code]

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

[/code]

coothead

1 Like

Hi.

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.