https://jsfiddle.net/Microsmsm/rpae6vhL/
When I separate the function it don't work as that on jsfiddle !
function myFunction() {
'https://jsfiddle.net/'
}
<img onclick="myFunction()" src="http://doc.jsfiddle.net/_downloads/jsfiddle-logo.png" alt="">
Please tell me where is the problem ?
