Studyon Minte9.com
jQuery




Get all elements



<script type='text/javascript'>

	$(document).ready(function() {
		$('input').each(function(index) {
			$(this).click(function(){
				if ($(this).val() != "Salveaza")
				$(this).val('');
			});
		});
	});
	
	function validate() {

		var valid = true;

		$('input, select').each(function(index) {
			if($(this).val() == 0 || $(this).val() == "") {
				valid = false;
			}
		});

		if (valid == false) {
			alert("Completati toate campurile!");
		}

		return valid;
	}

</script>


http://stackoverflow.com/questions/12862601/jquery-get-all-form-elements-input-textarea-select