Adding elements with javascript

.append() You can add text or obvjects youve created NOTE YOU WON’T SEE THE RESULT WITH VIEW HTML !!!! When used inside a “jQuery(document).ready(function(){” for instance, the append happens by the browser after the page has loaded, so it will seem like it hasn’t worked if you view a pages html in the browser. You […]

Read More

Getting Values

Get Value Of An Attribute HTML <a href="javascript:void(0)" class="our_jquery_dialog" title="The Title" message="A message" usage_id="12345">Open The Form</a> Javascript var usage_id = $(this).attr("usage_id"); Get Value Of A Form TextArea HTML <textarea id='text_area_1' style='width:100%;' rows='2'>Default text</textarea> Javascript var new_text = $('textarea#text_area_1').val();  

Read More

Changing the contents of html elements

Element types? Can be anything, so <div id=”, <span id=”, <p id=”, etc N.B. You need to place the <script> after the HTML element, or call it within say window.onload = function() (the div or whatever tag you’ve used must be before the javascript on the page) In your html To manipulate text within a […]

Read More