/    Sign up×
Community /Pin to ProfileBookmark

why isnt this working?

Hey,

Im new to scripting/ programming so please excuse my newbieness…

I have this function:

function dropdownlinks(){
document.getElementById(“searchs”).style.top=”100″:

}

I then have this code which is meant to insert an image on my webpage, and then call the function (a drop down menu) when the user clicks on the image.

<img src=”h.jpg” style= “position:absolute; top: 150px; right: 0px;” onClick=”javascript:dropdownlinks();”>

However this is not working! Any help would be great ?

kind regards, Rob

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@Declan1991Mar 21.2008 — Two things:

Specify a unit and a semi-colon, not a colon is the end-of-line character:<i>
</i>function dropdownlinks(){
document.getElementById("searchs").style.top="100[COLOR=RED]px[/COLOR]"[COLOR=RED];[/COLOR]
}
×

Success!

Help @robroy85 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...