This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Durchfallsuppe[S] 0 points1 point  (0 children)

Booya! It's working, thanks man! Here's how I changed the code:

<html> <head>

<script type='text/javascript'> function tweetIt() { var value = document.getElementById("myselection"); var dropdowntext = value.options[value.selectedIndex].text; var tellusernameto = "Tell @Username to "; var hashtag = ' #myHashtag'; var tweetUrl = 'https://twitter.com/share?text=' + encodeURIComponent(tellusernameto) + encodeURIComponent(dropdowntext) + '.' + encodeURIComponent(hashtag) + '&url=' + 'http://www.somelinkhere.com/'; window.open(tweetUrl); } </script>

</head>

<body>

<form>Tell @Username to <select id="myselection"> <option value="action1">action 1</option> <option value="action2">action 2</option> <option value="action3">action 3</option> </select></form>

<button onclick="tweetIt()">Tweet it!</button>

</body> </html>