Posts Tagged ‘HTML’

How to fire event from javascript (Dynamic)

August 13, 2010 Leave a comment

I had a requirement to call onchange event of a select box (combo box) from JavaScript and the function has an input param as event. I found one article which helped me to achieve this for one of my clients mobile web site (Land Rover UK), when I was working at

The article link is Firing Javascript Events (like onchange)

Here is the code which I had to change a little bit to fit in my code:

function fireEvent(element,event){
if (document.createEventObject){
// dispatch for IE
var evt = document.createEventObject();
return element.fireEvent('on'+event,evt)
// dispatch for firefox + others
var evt = document.createEvent("HTMLEvents");
evt.initEvent(event, true, true ); // event type,bubbling,cancelable
return !element.dispatchEvent(evt);

Here is the code for how to call this method:


Thanks to Jehiah

Categories: Browser, HTML, JavaScript Tags: , ,

iPhone – Mobile web site

July 27, 2010 Leave a comment

I had requirement to show number keyboard when on iPhone and user clicks on phone number input box and found this article which is very helpful and informative:
Thanks to Ben Nadel:


Another link which could be helpful, which I found on the above blog was from Raymond Camden.

Apple Docs on iPhone specific Safari web content

And third link for iPhopne HTML5 stuff, about storing large quantity of data on client side


HTML5 documentation on W3C Docs

Categories: HTML, iPhone Tags: ,