querySelector function

  1. @Deprecated('Directly use document.querySelector instead.')
Element? querySelector(
  1. String selector
)

Finds and returns the first element within the document that matches the specified CSS selector string. If no match is found, null is returned.

Deprecated in favor of querying directly on the document:

final dartDiv = document.querySelector('div.dart');

Implementation

@Deprecated('Directly use document.querySelector instead.')
Element? querySelector(String selector) => document.querySelector(selector);