10 examples of 'onclick clear input field javascript' in JavaScript

Every line of 'onclick clear input field javascript' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
48function handleClickClear() {
49 onChange('');
50 $input.current.focus();
51}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

30_onClearClick () {
31 this.setVal('')
32}
53function clearInputFields() {
54 $("#componentNameInput").val("");
55 $("#componentVersionInput").val("");
56 $("#componentGroupInput").val("");
57 $("#componentDescriptionInput").val("");
58 $("#componentLicenseSelect").val("");
59 $("#componentFilenameInput").val("");
60 $("#componentPurlInput").val("");
61 $("#componentCpeInput").val("");
62 $("#componentCopyrightInput").val("");
63 $("#componentMd5Input").val("");
64 $("#componentSha1Input").val("");
65 $("#componentSha256Input").val("");
66 $("#componentSha512Input").val("");
67 $("#componentSha3256Input").val("");
68 $("#componentSha3512Input").val("");
69}
63function clearInputFields() {
64 $("#vulnerabilityVulnIdInput").val("");
65 $("#vulnerabilityTitleInput").val("");
66 $("#vulnerabilitySubtitleInput").val("");
67 $("#vulnerabilityDescriptionInput").val("");
68 $("#vulnerabilityRecommendationInput").val("");
69 $("#vulnerabilityReferencesInput").val("");
70 $("#vulnerabilityCreditsInput").val("");
71 //$("#vulnerabilityCreatedInput").val("");
72 //$("#vulnerabilityPublishedInput").val("");
73 //$("#vulnerabilityUpdatedInput").val("");
74 $("#vulnerabilityCweSelect").val("");
75 //todo calculator buttons
76 $("#vulnerabilityVulnerableVersionsInput").val("");
77 $("#vulnerabilityPatchedVersionsInput").val("");
78}
10function clickclear(thisfield, defaulttext) {
11if (thisfield.value == defaulttext) {
12thisfield.value = "";
13}
14}
90function onclickGSPClearOutput() {
91 $("#GSPExtensionResult").val("");
92 $("#GSPUserDataResult").val("");
93 $("#GSPCommonFilesResult").val("");
94 $("#GSPMyDocumentsResult").val("");
95 $("#GSPHostApplicationResult").val("");
96}
64private _handleClearInputButtonClick() {
65 if (this.value) {
66 this.dispatchEvent(
67 new CustomEvent((this.constructor as typeof BXSearch).eventAfterInput, {
68 bubbles: true,
69 composed: true,
70 cancelable: false,
71 detail: {
72 value: '',
73 },
74 })
75 );
76 this.value = '';
77 }
78}
34onInputClear() {
35 this.setState(() => ({
36 expanded: false,
37 value: '',
38 }));
39}
52function clearInput( frm ) {
53 $( frm ).val( "" );
54}
54handleClear(e) {
55 e.stopPropagation();
56 this.props.onClear && this.props.onClear();
57 this.handleChange('');
58}

Related snippets