function showStuff(id, text, btn) { document.getElementById(id).style.display = 'block'; // hide the lorem ipsum text document.getElementById(text).style.display = 'none'; // hide the link btn.style.display = 'none'; }
<td class="post"> <a href="#" onclick="showStuff('answer1', 'text1', this); return false;">Edit</a> <span id="answer1" style="display: none;"> <textarea rows="10" cols="115"></textarea> </span> <span id="text1">Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum</span> </td>
Related Posts:
- addEventListener vs onclick
- How do I check if an array includes a value in JavaScript?
- JavaScript document.getElementById().value logs empty value
- What is console.log?
- How do I copy to the clipboard in JavaScript?
- Array of JSON Objects
- Cannot read property ‘push’ of undefined when combining arrays
- window.onload vs document.onload
- Fetch: POST JSON data
- Express error – TypeError: Router.use() requires middleware function but got a Object
- How can I check for “undefined” in JavaScript? [duplicate]
- How can I reverse an array in JavaScript without using libraries?
- Download File Using JavaScript/jQuery
- Does JavaScript pass by reference? [duplicate]
- How to resolve the C:\fakepath?
- React this.setState is not a function
- AngularJS- Login and Authentication in each route and controller
- Check if a variable is a string in JavaScript
- TypeError: Cannot read property ‘then’ of undefined
- MRAID file reference
- How to format numbers?
- Does parseDouble exist in JavaScript?
- What does !1 and !0 mean in Javascript?
- How to use php code in javascript
- How to read xml file contents in jQuery and display in html elements?
- using lodash .groupBy. how to add your own keys for grouped output?
- Uncaught ReferenceError: google is not defined when trying to use Google Places API without a map
- Why is window.showModalDialog deprecated? What to use instead?
- Should I use JSLint or JSHint JavaScript validation?
- node.js TypeError: path must be absolute or specify root to res.sendFile [failed to parse JSON]
- Delete first character of a string in Javascript
- How do I get the current time only in JavaScript
- Angular: conditional class with *ngClass
- Failed to compile. Module not found: Can’t resolve ‘react-router-dom’
- push object into array
- module.exports “Module is not defined”
- Why doesn’t JavaScript support multithreading?
- plain count up timer in javascript
- Uncaught TypeError: Cannot read property ‘name’ of undefined
- How to calculate date difference in JavaScript?
- React’s setState method with prevState argument
- How to measure time taken by a function to execute
- Can’t perform a React state update on an unmounted component
- How to simulate a click with JavaScript?
- This.props.dispatch not a function – React-Redux
- this vs $(this)
- “google is not defined” when using Google Maps V3 in Firefox remotely
- how to call a onclick function in tag?
- How to sort an array of integers correctly
- Failed to execute ‘postMessage’ on ‘DOMWindow’: https://www.youtube.com !== http://localhost:9000
- How can I check whether a radio button is selected with JavaScript?
- stopPropagation vs. stopImmediatePropagation
- typescript – cloning object
- Ajax success function
- What is the equivalent of Java’s System.out.println() in Javascript?
- How can I exit from a javascript function? [duplicate]
- Object doesn’t support property or method ‘addEventListener’
- Register and enqueue conditional (browser-specific) javascript files?
- Implementing Isomorphic JavaScript (React JS) in WordPress?
- Any advantage of using wp_scripts and is_IE when enqueuing scripts
- How to replace regular jquery calls with CDN calls from Google?
- Editing Source Code in WordPress
- TinyMCE in a div / textarea on frontend?
- Why is this gutenberg custom format button only available from the toolbar as a dropdown?
- WordPress problem with htmlentities
- VB.net and WordPress
- Gutenberg passing block attributes to component in ES6/ESNext
- How to add a custom.js file for a child-theme in a swift way?
- WP REST API Post Status Using JavaScript
- var is undefined in a Gutenberg block
- Script Localization doesn’t work
- How to conditionally show/hide controls & sections in WordPress customizer?
- Uncaught TypeError [closed]
- Got a TypeError after update and need to adapt found solution
- How do you filter the list of states when country is selected? [closed]
- Prevent update_checkout from firing mid-typing
- How to move core js files into the footer
- Building a Featured Gallery component for Gutenberg
- Suddenly extra hex string in tags
- Retrieving data about comments and likes
- Including Styles and JS files to work ON my plugin interface
- Linking wp_enqueue can’t find the javascript file (adds “?ver=x.x.x” to the src)
- Gutenberg – useEffect manipulate DOM after block re-renders DOM
- My code will not execute in wordpress, even though I’ve been told the code is fine
- JSX SVG Icon with WordPress
- Javascript working on jsfiddle but not wordpress site?
- Drodown list return issue
- Spans in gutenberg
- Get a default customizeAction text for a section using Customizer JS API
- Put dynamic Javascript in header after doing operations
- Adding javascript blocks to a single file and adding it to the header
- How to integrate a different (JavaScript) editor in WordPress?
- custom page url slug needs illegal ?id=1 for javascript
- How to delete child block for associated parent block
- Registration fields prefilled with URL parameters
- Divi Carousel/ Slider – How to slide two sliders with a single button
- WordPress adds and tags into HTML blocks after saving
- How do i fix type error
- CCF7 Field numbuer prefilled after Click event
- Access jQuery tabs from primary menu while adding/removing class on tab container elements (accessing diff. tabs/tab content via primary menu items)