Try this
<div onclick="someFunction('close')">content</div>
function someFunction(action){
window.location.hash=action;
}
Pregunta
I'm using html5/css3 modal window from here http://www.webdesignerdepot.com/2012/10/creating-a-modal-window-with-html5-and-css3/ , you turn it off by clicking on link
<a href="#close">X</a>
but how could I make it to work like this with a function?
<div onclick="someFunction">
content
</div>
Thank you.
Solución
Try this
<div onclick="someFunction('close')">content</div>
function someFunction(action){
window.location.hash=action;
}