Thursday, March 13, 2014

Angularjs html css ui developer interview questions


  1. What are the difference between HTML4 and HTML5 ? 
  2. What are the new features in HTML5 on which did u work on it ? 
  3. What are the new tags in HTML5 ? 
  4. What is the difference between simple cookies and new storage mechanism in HTML5 ?
  5. Need to find out an output of a new for loop code with 'continue' and  'break' ?
  6. Need to find out output of a new java script with createElement and binding with HTML listener code ?
  7. Simple code for setting up cookies with javascript ? 
  8. Create a Cookie with JavaScript

    JavaScript can create cookies, read cookies, and delete cookies with the property document.cookie.
    With JavaScript, a cookie can be created like this:
    document.cookie="username=John Doe";
    You can also add an expiry date (in UTC or GMT time). By default, the cookie is deleted when the browser is closed:
    document.cookie="username=John Doe; expires=Thu, 18 Dec 2013 12:00:00 GMT";
    With a path parameter, you can tell the browser what path the cookie belongs to. By default, the cookie belongs to the current page.
    document.cookie="username=John Doe; expires=Thu, 18 Dec 2013 12:00:00 GMT; path=/";

    Read a Cookie with JavaScript

    With JavaScript, cookies can be read like this:
    var x = document.cookie;

    Notedocument.cookie will return all cookies in one string much like: cookie1=value; cookie2=value; cookie3=value;
  9. How a private variable implementation with javascript ? 
  10. How to create a simple object with javascript?
  11. Creating a Direct Instance

    The following example creates a new instance of an object, and adds four properties to it:

    Example

    person=new Object();
    person.firstname="John";
    person.lastname="Doe";
    person.age=50;
    person.eyecolor="blue";
  12. Alternative syntax (using object literals):

    Example

    person={firstname:"John",lastname:"Doe",age:50,eyecolor:"blue"};
  13. Using an Object Constructor

    The following example uses a function to construct the object:

    Example

    function person(firstname,lastname,age,eyecolor)
    {
    this.firstname=firstname;
    this.lastname=lastname;
    this.age=age;
    this.eyecolor=eyecolor;
    }
  14. Creating JavaScript Object Instances

    Once you have an object constructor, you can create new instances of the object like this:
    var myFather=new person("John","Doe",50,"blue");
    var myMother=new person("Sally","Rally",48,"green");
  15. What is closures in javascript ?
  16. What are the difference between CSS and CSS3 ?
  17. What are the events in javascript ?
  18. How to implement OOPs in javascript ?
Events in javascript

Input Events



Mouse Events



Click Events



Load Events



Others

  1. Need to find out an output of a new for loop code with 'continue' and  'break' ?
<!DOCTYPE html>
<html>
<body>

<p>Click the button to do a loop with a break.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>

<script>
function myFunction()
{
var x="",i=0;
for (i=0;i<10;i++)
  {
  if (i==3)
    {
    break;
    }
  x=x + "The number is " + i + "<br>";
  }
document.getElementById("demo").innerHTML=x;
}
</script>

</body>
</html>
  1. Need to find out an output of a new for loop code with 'continue' and  'break' ?

<!DOCTYPE html>

<html>
<body>

<p>Click the button to do a loop which will skip the step where i=3.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>

<script>
function myFunction()
{
var x="",i=0;
for (i=0;i<10;i++)
  {
  if (i==3)
    {
    continue;
    }
  x=x + "The number is " + i + "<br>";
  }
document.getElementById("demo").innerHTML=x;
}
</script>

</body>
</html>

1 comment: