Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to open a new tab in react

//More Secure Solution. For JS only.

const openInNewTab = (url) => {
  const newWindow = window.open(url, '_blank', 'noopener,noreferrer')
  if (newWindow) newWindow.opener = null
}

//Then add to your onClick
onClick={() => openInNewTab('https://stackoverflow.com')}
Comment

open a new tab when clicking on a link react

<td onClick={()=> window.open("someLink", "_blank")}>text</td>
Comment

react onclick new tab

const openInNewTab = (url) => {
  const newWindow = window.open(url, '_blank', 'noopener,noreferrer')
  if (newWindow) newWindow.opener = null
}
Comment

open in a new tab react

<td onClick={()=> window.open("someLink", "_blank")}>text</td>
Comment

how i do button when click open a new tab in react

<a  className="btn btn-primary  btn-outline btn-lg"  href="https://google.com/" rel="noopener noreferrer" target="_blank">google</a>
Comment

PREVIOUS NEXT
Code Example
Javascript :: json nuget package manager 
Javascript :: javascript array of all characters 
Javascript :: find item in object js 
Javascript :: react native local.properties 
Javascript :: javascript round to 2 decimal places 
Javascript :: nodejs copy to clipboard 
Javascript :: nodejs delete folder recursively 
Javascript :: A VirtualizedList contains a cell which itself contains more than one VirtualizedList of the same orientation as the parent list. You must pass a unique listKey prop to each sibling list. 
Javascript :: check if enter key is pressed jquery 
Javascript :: javacript open url in new tab 
Javascript :: jquery in checkbox checked 
Javascript :: angular generate guid 
Javascript :: jquery nth child 
Javascript :: js check if value is not empty string 
Javascript :: refresh date and time every second angular 
Javascript :: tailwind install nextjs 
Javascript :: enable select jquery 
Javascript :: sass node sass loder 
Javascript :: get guild by id discord.js 
Javascript :: Handlebars: Access has been denied to resolve the property 
Javascript :: javascript simulate key press 
Javascript :: javascript truncate with ellipsis 
Javascript :: remove multiple values from array javascript 
Javascript :: count 1 to 5 javascript 
Javascript :: exceljs read file from input 
Javascript :: discord login with token 
Javascript :: javascript custom events with data 
Javascript :: adonis js sort by 
Javascript :: useRoutes exact path match in react 
Javascript :: datatable loading 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =