顯示包含「JavaScript」標籤的文章。顯示所有文章
顯示包含「JavaScript」標籤的文章。顯示所有文章

2016年6月18日星期六

JavaScript 03: Create Event

Create Event

Intro:

一個簡單的實習。
Click一下 Go button,透過JS code generate 一個click event,去click 一下paragraph1 和paragraph2。
當element被click時,text field就會顯示clicked字眼,一石二烏。
GIF:
GIF
Code:
JS Fiddle code: Create Event

2016年5月30日星期一

JavaScript02:Computed Stycle,"getComputedStyle",

原因:

如果想知道某一個element的現時style,就需要用到getComputedStyle(elemnet,xxx) method.
第二個參數xxx一定為null或不寫,如想查的是一般的element。
JS Fiddle:https://jsfiddle.net/js_Test4fun/qejv4yd0/17/